From caf84e233d924235a87693142a8aa7dda4e85e81 Mon Sep 17 00:00:00 2001 From: Juan Patricio Marroquin Date: Thu, 7 Nov 2024 08:41:17 -0500 Subject: [PATCH 01/12] refactor: implement transaction summary on details modal --- .../TransactionSummary/TransactionSummary.tsx | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/domains/transaction/components/TransactionDetail/TransactionSummary/TransactionSummary.tsx b/src/domains/transaction/components/TransactionDetail/TransactionSummary/TransactionSummary.tsx index 260ecef58b..367045d8e9 100644 --- a/src/domains/transaction/components/TransactionDetail/TransactionSummary/TransactionSummary.tsx +++ b/src/domains/transaction/components/TransactionDetail/TransactionSummary/TransactionSummary.tsx @@ -4,6 +4,7 @@ import { Contracts, DTO } from "@ardenthq/sdk-profiles"; import { DetailDivider, DetailLabelText, DetailWrapper } from "@/app/components/DetailWrapper"; import { Amount, AmountLabel } from "@/app/components/Amount"; import { BigNumber } from "@ardenthq/sdk-helpers"; +import { TransactionAmountLabel } from "@/domains/transaction/components/TransactionTable/TransactionRow/TransactionAmount.blocks"; interface Properties { transaction: DTO.ExtendedSignedTransactionData | DTO.ExtendedConfirmedTransactionData; @@ -20,12 +21,7 @@ export const TransactionSummary = ({ transaction, senderWallet, labelClassName } <>
{t("COMMON.AMOUNT")} - +
From 73648460873fbec77519fccaf19fb085e421593e Mon Sep 17 00:00:00 2001 From: Juan Patricio Marroquin Date: Thu, 7 Nov 2024 08:41:45 -0500 Subject: [PATCH 02/12] chore: update snapshots --- .../MultiSignatureDetail.test.tsx.snap | 8 +- .../__snapshots__/SentStep.test.tsx.snap | 6 +- .../TransactionDetailModal.test.tsx.snap | 76 +- .../SendTransfer.Fees.test.tsx.snap | 2921 --- .../__snapshots__/SendTransfer.test.tsx.snap | 16134 ++++------------ 5 files changed, 3622 insertions(+), 15523 deletions(-) delete mode 100644 src/domains/transaction/pages/SendTransfer/__snapshots__/SendTransfer.Fees.test.tsx.snap diff --git a/src/domains/transaction/components/MultiSignatureDetail/__snapshots__/MultiSignatureDetail.test.tsx.snap b/src/domains/transaction/components/MultiSignatureDetail/__snapshots__/MultiSignatureDetail.test.tsx.snap index 24ae1bf428..6c65d5a870 100644 --- a/src/domains/transaction/components/MultiSignatureDetail/__snapshots__/MultiSignatureDetail.test.tsx.snap +++ b/src/domains/transaction/components/MultiSignatureDetail/__snapshots__/MultiSignatureDetail.test.tsx.snap @@ -498,18 +498,18 @@ exports[`MultiSignatureDetail > should not broadcast if wallet is not ready to d Amount
- + 1 DARK + - 2 DARK
diff --git a/src/domains/transaction/components/MultiSignatureDetail/__snapshots__/SentStep.test.tsx.snap b/src/domains/transaction/components/MultiSignatureDetail/__snapshots__/SentStep.test.tsx.snap index 2227c1823c..9926e5496c 100644 --- a/src/domains/transaction/components/MultiSignatureDetail/__snapshots__/SentStep.test.tsx.snap +++ b/src/domains/transaction/components/MultiSignatureDetail/__snapshots__/SentStep.test.tsx.snap @@ -546,7 +546,7 @@ exports[`Multisignature Detail Sent Step > should render sent step %s 1`] = ` Amount
@@ -554,10 +554,10 @@ exports[`Multisignature Detail Sent Step > should render sent step %s 1`] = ` class="flex h-full items-center space-x-1" > - - 100 DARK + - 121 DARK
diff --git a/src/domains/transaction/components/TransactionDetailModal/__snapshots__/TransactionDetailModal.test.tsx.snap b/src/domains/transaction/components/TransactionDetailModal/__snapshots__/TransactionDetailModal.test.tsx.snap index d5a65eed82..6594460342 100644 --- a/src/domains/transaction/components/TransactionDetailModal/__snapshots__/TransactionDetailModal.test.tsx.snap +++ b/src/domains/transaction/components/TransactionDetailModal/__snapshots__/TransactionDetailModal.test.tsx.snap @@ -467,7 +467,7 @@ exports[`TransactionDetailModal > should render a ipfs modal 1`] = ` Amount
@@ -475,10 +475,10 @@ exports[`TransactionDetailModal > should render a ipfs modal 1`] = ` class="flex h-full items-center space-x-1" > - - 100 DARK + - 121 DARK
@@ -1195,7 +1195,7 @@ exports[`TransactionDetailModal > should render a magistrate modal 1`] = ` Amount
@@ -1203,10 +1203,10 @@ exports[`TransactionDetailModal > should render a magistrate modal 1`] = ` class="flex h-full items-center space-x-1" > - - 100 DARK + - 121 DARK
@@ -2005,18 +2005,52 @@ exports[`TransactionDetailModal > should render a multi payment modal 1`] = ` Amount
+
+
+ + + + +
+
- - 100 DARK + - 119 DARK
@@ -2928,7 +2962,7 @@ exports[`TransactionDetailModal > should render a multi signature modal 1`] = ` Amount
@@ -2936,10 +2970,10 @@ exports[`TransactionDetailModal > should render a multi signature modal 1`] = ` class="flex h-full items-center space-x-1" > - - 100 DARK + - 121 DARK
@@ -3936,7 +3970,7 @@ exports[`TransactionDetailModal > should render a transfer modal 1`] = ` Amount
@@ -3944,10 +3978,10 @@ exports[`TransactionDetailModal > should render a transfer modal 1`] = ` class="flex h-full items-center space-x-1" > - - 100 DARK + - 121 DARK
@@ -4738,7 +4772,7 @@ exports[`TransactionDetailModal > should render a transfer modal with memo 1`] = Amount
@@ -4746,10 +4780,10 @@ exports[`TransactionDetailModal > should render a transfer modal with memo 1`] = class="flex h-full items-center space-x-1" > - - 100 DARK + - 121 DARK
@@ -5466,7 +5500,7 @@ exports[`TransactionDetailModal > should render an unlock tokens modal 1`] = ` Amount
@@ -5474,10 +5508,10 @@ exports[`TransactionDetailModal > should render an unlock tokens modal 1`] = ` class="flex h-full items-center space-x-1" > - - 100 DARK + - 121 DARK
diff --git a/src/domains/transaction/pages/SendTransfer/__snapshots__/SendTransfer.Fees.test.tsx.snap b/src/domains/transaction/pages/SendTransfer/__snapshots__/SendTransfer.Fees.test.tsx.snap deleted file mode 100644 index 18970b1de7..0000000000 --- a/src/domains/transaction/pages/SendTransfer/__snapshots__/SendTransfer.Fees.test.tsx.snap +++ /dev/null @@ -1,2921 +0,0 @@ -// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html - -exports[`SendTransfer Fee Handling > should send a single transfer with a high fee by confirming the fee warning 1`] = ` -
-
-
-
-
- -
- -
- -
-
- -
-
-
-
-
-
-
-
-
- - Transaction Confirmed - -
    -
  • -
  • -
  • -
  • -
-
-
- -
-
-
-
-
-
- Transaction ID -
-
-
- 8f913...49877 -
-
-
- - -
-
-
-
-
-
-
-
- -
-
-
-
-
-
-
-
-`; - -exports[`SendTransfer Fee Handling > should send a single transfer with a low fee by confirming the fee warning 1`] = ` -
-
-
-
-
- -
- -
- -
-
- -
-
-
-
-
-
-
-
-
- - Transaction Confirmed - -
    -
  • -
  • -
  • -
  • -
-
-
- -
-
-
-
-
-
- Transaction ID -
-
-
- 8f913...49877 -
-
-
- - -
-
-
-
-
-
-
-
- -
-
-
-
-
-
-
-
-`; diff --git a/src/domains/transaction/pages/SendTransfer/__snapshots__/SendTransfer.test.tsx.snap b/src/domains/transaction/pages/SendTransfer/__snapshots__/SendTransfer.test.tsx.snap index f82b3f8136..5ca65162a1 100644 --- a/src/domains/transaction/pages/SendTransfer/__snapshots__/SendTransfer.test.tsx.snap +++ b/src/domains/transaction/pages/SendTransfer/__snapshots__/SendTransfer.test.tsx.snap @@ -1,9 +1,9 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html -exports[`SendTransfer > should display unconfirmed transactions modal when submitting with Enter 1`] = ` +exports[`SendTransfer > should error if wrong mnemonic 1`] = `
-
+
-
- Transaction ID -
-
+
+
+
- 8f913...49877 + + + + + + +
-
+
-
+ +
+
+
+ + -
-
- -
-
- -
- -
-
- +
+ + + + + + +
+
+
+
+ Recipient +
+
+ +
+ + Single + + + + Multiple + +
+
+
+
+ + + + + +
+
+
+
+
+
+
+
+
+
+
+ +
+
+
+
-
-
- Confirmations -
-
-
-
-
-
-
- - - - - -
-

- Success -

-
-
-

- - 10 Confirmations - - -

-
-
-
+
- -
+ +
+
+
+
+
+
+
+ +
+
+ +
+
+
+ + 0/255 + +
+
+
+
+
+ +
+
+
+ +
+
- +
- +
- + - +
- - + + `; -exports[`SendTransfer > should send a single transfer without keyboard 1`] = ` -
+exports[`SendTransfer > should render network selection without selected wallet 1`] = ` +
+
+
+
+ +
+ +
+ +
+
-
-
-
- -
- -
-
-
-
-
-
-
-
-
- - Transaction Confirmed - -
    -
  • -
  • -
  • -
  • -
-
-
- -
-
-
-
- Transaction ID -
-
-
- 8f913...49877 -
-
-
- - -
+ + + + +
+ +
+
+
+
+
+ -
-
- -
-
+ +
+
+ +
+
+
+
+
+ + + + + +
+
+
+ +
+
+
+
+
+ + Select a Cryptoasset + +
    +
  • +
  • +
  • +
  • +
  • +
+
+
+
+
+ + +
+
+ +
+
+
+ + +`; + +exports[`SendTransfer > should render network step with dropdown 1`] = ` + +
+
+
+ + Select a Cryptoasset + +
    +
  • +
  • +
  • +
  • +
+
+
+ +
+
+
+ +
+
+
+
+ +
+
+
+
+
+
+`; + +exports[`SendTransfer > should render network step with network cards 1`] = ` + +
+
+
+ + Select a Cryptoasset + +
    +
  • +
  • +
  • +
  • +
+
+
+ +
+
+
+
+
+
  • +
    +
    +
    +
    + + + +
    +
    +
    + ARK +
    +
    +
    +
  • +
  • +
    +
    +
    +
    + + + +
    +
    +
    + ARK Devnet +
    +
    + +
    + + + +
    +
    +
    +
  • +
    +
    +
    +
    +
    +
    +`; + +exports[`SendTransfer > should render review step 1`] = ` + +
    +
    +
    + + Transaction Review + +
      +
    • +
    • +
    • +
    • +
    +
    +
    + +
    +
    +
    +
    +
    +
    + Addressing +
    +
    +
    +
    +
    + From +
    +
    + + + ARK Wallet 1 + + +
    + + D8rr7B1d6TL6pf14LgMz4sKp1VBMs6YUYD + + +   + +
    + +
    +
    + +
    +
    +
    +
    + Memo (SmartBridge) +
    +
    +
    +

    + test memo +

    +
    +
    +
    +
    +
    + Transaction Summary +
    +
    +
    +
    +
    +
    +
    + + Transaction(s) Amount + + + 1 DARK + +
    +
    + + Transaction Fee + + + 1 DARK + +
    +
    +
    +
    +
    + + - +
    +
    +
    + + Total Amount + + + 2 DARK + +
    +
    +
    +
    +
    +
    + , +
    +`; + +exports[`SendTransfer > should render review step with multiple recipients (with memo) 1`] = ` + +
    +
    +
    + + Transaction Review + +
      +
    • +
    • +
    • +
    • +
    +
    +
    + +
    +
    +
    +
    +
    +
    + Addressing +
    +
    +
    +
    +
    + From +
    +
    + + + ARK Wallet 1 + + +
    + + D8rr7B1d6TL6pf14LgMz4sKp1VBMs6YUYD + + +   + +
    + +
    +
    + +
    +
    +
    + Memo (SmartBridge) +
    +
    +
    +

    + memo +

    +
    +
    +
    +
    +
    + Transaction Summary +
    +
    +
    +
    +
    +
    +
    + + Transaction(s) Amount + + + 2 DARK + +
    +
    + + Transaction Fee + + + 1 DARK + +
    +
    +
    +
    +
    + + - -
    + + + +
    + + Total Amount + + + 3 DARK + +
    + + + + + + , +
    +`; + +exports[`SendTransfer > should render review step with multiple recipients (without memo) 1`] = ` + +
    +
    +
    + + Transaction Review + +
      +
    • +
    • +
    • +
    • +
    +
    +
    + +
    +
    +
    +
    +
    +
    + Addressing +
    +
    +
    +
    +
    + From +
    +
    + + + ARK Wallet 1 + + +
    + + D8rr7B1d6TL6pf14LgMz4sKp1VBMs6YUYD + + +   +
    + +
    +
    + +
    +
    +
    +
    + Transaction Summary +
    +
    +
    +
    +
    +
    +
    + + Transaction(s) Amount + + + 2 DARK + +
    +
    + + Transaction Fee + + + 1 DARK + +
    +
    +
    +
    - Back to Wallet + + + + +
    - +
    - +
    + + Total Amount + + + 3 DARK + +
    +
    -
    - +
    + , +
    `; From 0ecf5c3f2a668bc8fcff52479eab49cf0e90cf5e Mon Sep 17 00:00:00 2001 From: Juan Patricio Marroquin Date: Thu, 7 Nov 2024 09:12:50 -0500 Subject: [PATCH 03/12] fix: eslint issues --- .../TransactionDetail/TransactionSummary/TransactionSummary.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/domains/transaction/components/TransactionDetail/TransactionSummary/TransactionSummary.tsx b/src/domains/transaction/components/TransactionDetail/TransactionSummary/TransactionSummary.tsx index 367045d8e9..bb534b1dcf 100644 --- a/src/domains/transaction/components/TransactionDetail/TransactionSummary/TransactionSummary.tsx +++ b/src/domains/transaction/components/TransactionDetail/TransactionSummary/TransactionSummary.tsx @@ -2,7 +2,7 @@ import React, { ReactElement } from "react"; import { useTranslation } from "react-i18next"; import { Contracts, DTO } from "@ardenthq/sdk-profiles"; import { DetailDivider, DetailLabelText, DetailWrapper } from "@/app/components/DetailWrapper"; -import { Amount, AmountLabel } from "@/app/components/Amount"; +import { Amount } from "@/app/components/Amount"; import { BigNumber } from "@ardenthq/sdk-helpers"; import { TransactionAmountLabel } from "@/domains/transaction/components/TransactionTable/TransactionRow/TransactionAmount.blocks"; From 6a03ee444a9fa5df80ccaade171679a2661bdfe4 Mon Sep 17 00:00:00 2001 From: Juan Patricio Marroquin Date: Thu, 7 Nov 2024 11:24:56 -0500 Subject: [PATCH 04/12] chore: update snapshots --- .../NotificationsDropdown.test.tsx.snap | 8 +- .../__snapshots__/SendTransfer.test.tsx.snap | 14836 +++++++++++++--- 2 files changed, 11929 insertions(+), 2915 deletions(-) diff --git a/src/app/components/Notifications/__snapshots__/NotificationsDropdown.test.tsx.snap b/src/app/components/Notifications/__snapshots__/NotificationsDropdown.test.tsx.snap index 7bc3181006..21fe4f73e5 100644 --- a/src/app/components/Notifications/__snapshots__/NotificationsDropdown.test.tsx.snap +++ b/src/app/components/Notifications/__snapshots__/NotificationsDropdown.test.tsx.snap @@ -533,18 +533,18 @@ exports[`Notifications > should open and close transaction details modal 1`] = ` Amount
    - - 1 DARK + 0.71370675 DARK
    diff --git a/src/domains/transaction/pages/SendTransfer/__snapshots__/SendTransfer.test.tsx.snap b/src/domains/transaction/pages/SendTransfer/__snapshots__/SendTransfer.test.tsx.snap index af13612c6f..d90313a858 100644 --- a/src/domains/transaction/pages/SendTransfer/__snapshots__/SendTransfer.test.tsx.snap +++ b/src/domains/transaction/pages/SendTransfer/__snapshots__/SendTransfer.test.tsx.snap @@ -1,9 +1,9 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html -exports[`SendTransfer > should error if wrong mnemonic 1`] = ` +exports[`SendTransfer > should display unconfirmed transactions modal when submitting with Enter 1`] = `
    -
    -
    - -
    -
    - + Transaction ID +
    +
    - - - - - - - + 8f913...49877
    - +
    +
    -
    - - -
    - - +
    + + + + + +
    + + + , + +`; + +exports[`SendTransfer > should render review step with multiple recipients (without memo) 1`] = ` + +
    +
    +
    + + Transaction Review + +
      +
    • +
    • +
    • +
    • +
    +
    +
    +
    -
    +
    +
    - + Addressing +
    +
    - +
    + From +
    +
    + + + ARK Wallet 1 + + +
    + + D8rr7B1d6TL6pf14LgMz4sKp1VBMs6YUYD + + +   + +
    + +
    +
    +
    +
    +
    +
    + To +
    +
    + + Multiple + + + (2) + + +
    +
    +
    +
    -
    -
    +
    - +
    + Transaction Summary +
    +
    - - Simple - - +
    + + Transaction Fee + + + 1 DARK + +
    +
    +
    +
    +
    + + + + + +
    +
    +
    +
    +
    - Advanced + Total Amount + + + 3 DARK
    +
    + + + + , + +`; + +exports[`SendTransfer > should send a single transfer and handle undefined expiration 1`] = ` +
    +
    +
    +
    +
    + - -
    +
    + +
    + + + +
    -
    - + +
    + +
    - - -`; - -exports[`SendTransfer > should render form step (xs) 1`] = ` - -
    -
    - - Send DARK - -
      -
    • -
    • -
    • -
    • -
    -
    -
    + +
    -
    -
    -
    -
    - - +
    - -
    - + + +
    + - -
    -
    +
    - Recipient +
    + Your Balance +
    +
    + + 0 BTC + +
    +
    + -
    +
    + +
    +
    +
    +
    -
    -
    +
    -
    +
    +
    +
    + + Transaction Confirmed + +
      +
    • +
    • +
    • +
    • +
    +
    +
    + +
    +
    - + Transaction ID +
    +
    +
    + 8f913...49877 +
    +
    +
    + +
    +
    +
    -
    - -
    -
    -
    -
    - -
    -
    -
    -
    - -
    -
    -
    -
    -
    -
    -
    - -
    -
    - -
    -
    -
    - - 0/255 - -
    -
    -
    -
    -
    - -
    -
    -
    - -
    -
    -
    -
    -
    - - -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -`; - -exports[`SendTransfer > should render network selection without selected wallet 1`] = ` - -
    -
    -
    -
    - -
    - -
    - +
    -
    - + +
    + + +`; + +exports[`SendTransfer > should send a single transfer and show unconfirmed transactions modal 1`] = ` +
    +
    +
    +
    +
    +
    + Transaction ID +
    +
    +
    + 8f913...49877 +
    +
    +
    + + +
    +
    +
    +
    - -
    -
    -
    - -
    -`; - -exports[`SendTransfer > should render network step with dropdown 1`] = ` - -
    -
    -
    - - Select a Cryptoasset - -
      -
    • -
    • -
    • -
    • -
    -
    -
    -
    + +
    - Select a Cryptoasset - -
    -
    - Select a cryptoasset to send funds from. + +
    - - - - -
    - -
    -
    -
    - -
    -
    -
    -
    -
    - -
    + + + `; -exports[`SendTransfer > should render network step with network cards 1`] = ` - -
    should send a single transfer using wallet with encryption password 1`] = ` +
    +
    - - Select a Cryptoasset - -
      -
    • -
    • -
    • -
    • -
    -
    + class="border-t border-theme-secondary-300 dark:border-theme-secondary-900" + data-testid="NavigationBar__buttons-separator" + />
    - -
    -
    -
    -
    +
    +
    +
    + +
    +
    -
    -
    -
    -
    -`; - -exports[`SendTransfer > should render review step 1`] = ` - -
    -
    +
    -
    -
    -
    -
    - Addressing -
    -
    -
    -
    - From +
    +
    - +
    + +
    +
    +
    + -
    - -
    -
    -
    - To -
    -
    - - - ARK Wallet 1 - - + Your Balance +
    - D8rr7B1d6TL6pf14LgMz4sKp1VBMs6YUYD - - -   + 0 BTC
    -
    +
    + +
    -
    -
    - Memo (SmartBridge) -
    -
    -
    -

    - test memo -

    -
    -
    -
    -
    - Transaction Summary -
    -
    -
    -
    -
    +
    -
    - - Transaction(s) Amount - - - 1 DARK - -
    -
    - - Transaction Fee - - + + Transaction Confirmed + +
      +
    • +
    • +
    • +
    • +
    +
    +
    + +
    +
    +
    - 1 DARK - -
    +
    +
    +
    + Transaction ID +
    +
    +
    + 8f913...49877 +
    +
    +
    + + +
    +
    +
    +
    +
    +
    -
    - - - - - + Back to Wallet
    -
    +
    -
    - - Total Amount - - - 2 DARK - -
    - + - - , -
    + + `; -exports[`SendTransfer > should render review step with multiple recipients (with memo) 1`] = ` - -
    should send a single transfer with keyboard 1`] = ` +
    +
    -
    - - Transaction Review - -
      -
    • -
    • -
    • -
    • -
    -
    -
    + +
    -
    -
    -
    -
    -
    - Addressing -
    -
    -
    -
    - From +
    +
    - +
    + +
    +
    +
    + -
    - -
    -
    -
    - To -
    -
    - - - Multiple - - - (2) - -
    -
    + Your Balance
    - + 0 BTC + +
    -
    -
    -
    -
    -
    - Memo (SmartBridge) -
    -
    -
    -

    - memo -

    -
    -
    -
    -
    -
    - Transaction Summary -
    -
    -
    +
    +
    + +
    +
    +
    +
    +
    -
    +
    + + Transaction Confirmed + +
      +
    • +
    • +
    • +
    • +
    +
    +
    + +
    +
    +
    - - +
    + Transaction ID +
    +
    +
    + 8f913...49877 +
    +
    +
    + + +
    +
    +
    +
    +
    +
    - -
    - - Total Amount - - - 3 DARK - + +
    - + - - , -
    + + `; -exports[`SendTransfer > should render review step with multiple recipients (without memo) 1`] = ` - -
    should send a single transfer without keyboard 1`] = ` +
    +
    -
    - - Transaction Review - -
      -
    • -
    • -
    • -
    • -
    -
    -
    + +
    -
    -
    -
    -
    -
    -
    - Addressing -
    -
    -
    +
  • + + Portfolio + +
  • +
  • + + Exchange + +
  • +
  • + + Contacts + +
  • +
  • + + Votes + +
  • +
    - From -
    - +
    +
    +
    + +
    +
    +
    + +
    +
    +
    + +
    -
    - Transaction Summary -
    -
    -
    -
    -
    +
    -
    - - Transaction(s) Amount - - - 2 DARK - -
    -
    - - Transaction Fee - - + + Transaction Confirmed + +
      +
    • +
    • +
    • +
    • +
    +
    +
    + +
    +
    +
    - 1 DARK - -
    +
    +
    +
    + Transaction ID +
    +
    +
    + 8f913...49877 +
    +
    +
    + + +
    +
    +
    +
    +
    +
    -
    - - - - - + Back to Wallet
    -
    +
    -
    - - Total Amount - - - 3 DARK - -
    - + - - , -
    + + `; From 31ef2843c51562ede27b4e308b89323d06c38d1f Mon Sep 17 00:00:00 2001 From: Juan Patricio Marroquin Date: Thu, 7 Nov 2024 11:35:12 -0500 Subject: [PATCH 05/12] wip --- src/utils/testing-library.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/utils/testing-library.tsx b/src/utils/testing-library.tsx index 10c7b8e225..5cd4e4612d 100644 --- a/src/utils/testing-library.tsx +++ b/src/utils/testing-library.tsx @@ -390,5 +390,7 @@ export const createTransactionMock = ( type: () => "transfer", usesMultiSignature: () => false, wallet: () => wallet, + total: () => +transactionFixture.data.amount / 1e8 + +transactionFixture.data.fee / 1e8, + isReturn: () => false, ...overrides, } as any); From be27b00cf9139b70631264802a41afe9e48b8f15 Mon Sep 17 00:00:00 2001 From: Juan Patricio Marroquin Date: Thu, 7 Nov 2024 11:41:01 -0500 Subject: [PATCH 06/12] wip --- src/utils/testing-library.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utils/testing-library.tsx b/src/utils/testing-library.tsx index 5cd4e4612d..a13f2ff081 100644 --- a/src/utils/testing-library.tsx +++ b/src/utils/testing-library.tsx @@ -375,6 +375,7 @@ export const createTransactionMock = ( isIpfs: () => false, isMultiPayment: () => false, isMultiSignatureRegistration: () => false, + isReturn: () => false, isSent: () => true, isTransfer: () => true, isUnvote: () => false, @@ -387,10 +388,9 @@ export const createTransactionMock = ( ], sender: () => transactionFixture.data.sender, timestamp: () => DateTime.make(), + total: () => +transactionFixture.data.amount / 1e8 + +transactionFixture.data.fee / 1e8, type: () => "transfer", usesMultiSignature: () => false, wallet: () => wallet, - total: () => +transactionFixture.data.amount / 1e8 + +transactionFixture.data.fee / 1e8, - isReturn: () => false, ...overrides, } as any); From 81b83ad014ddfa8d62c0ab24318989dff19194b5 Mon Sep 17 00:00:00 2001 From: Juan Patricio Marroquin Date: Fri, 8 Nov 2024 11:05:22 -0500 Subject: [PATCH 07/12] fix: unit tests --- .../components/UnlockTokens/UnlockTokensModal.test.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/domains/transaction/components/UnlockTokens/UnlockTokensModal.test.tsx b/src/domains/transaction/components/UnlockTokens/UnlockTokensModal.test.tsx index 9f96afa495..3280b854a8 100644 --- a/src/domains/transaction/components/UnlockTokens/UnlockTokensModal.test.tsx +++ b/src/domains/transaction/components/UnlockTokens/UnlockTokensModal.test.tsx @@ -83,11 +83,10 @@ describe("UnlockTokensModal", () => { isDelegateResignation: () => false, isIpfs: () => false, isMultiPayment: () => false, - isMultiPayment: () => false, isMultiSignatureRegistration: () => false, + isReturn: () => false, isSent: () => true, isTransfer: () => true, - isTransfer: () => true, isUnlockToken: () => true, isUnvote: () => false, isVote: () => true, @@ -96,6 +95,7 @@ describe("UnlockTokensModal", () => { recipient: () => wallet.address(), sender: () => transactionFixture.data.sender.address, timestamp: () => DateTime.make(), + total: () => 30, type: () => "unlockToken", usesMultiSignature: () => false, wallet: () => wallet, @@ -199,7 +199,7 @@ describe("UnlockTokensModal", () => { // continue to auth step - userEvent.click(screen.getByText(translations.COMMON.CONFIRM)); + await userEvent.click(screen.getByText(translations.COMMON.CONFIRM)); await expect(screen.findByTestId("AuthenticationStep")).resolves.toBeVisible(); From 76703f0980ed625b33fce515876db14dc4c9be28 Mon Sep 17 00:00:00 2001 From: Juan Patricio Marroquin Date: Fri, 8 Nov 2024 11:36:28 -0500 Subject: [PATCH 08/12] fix: unit tests --- .../pages/SendTransfer/SendTransfer.test.tsx | 4 ++++ .../__snapshots__/SendTransfer.test.tsx.snap | 12 ++++++------ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/domains/transaction/pages/SendTransfer/SendTransfer.test.tsx b/src/domains/transaction/pages/SendTransfer/SendTransfer.test.tsx index 7ff71d2b7e..b5ef2caa8d 100755 --- a/src/domains/transaction/pages/SendTransfer/SendTransfer.test.tsx +++ b/src/domains/transaction/pages/SendTransfer/SendTransfer.test.tsx @@ -64,6 +64,7 @@ const createTransactionMock = (wallet: Contracts.IReadWriteWallet) => isIpfs: () => false, isMultiPayment: () => false, isMultiSignatureRegistration: () => false, + isReturn: () => false, isSent: () => true, isTransfer: () => true, isUnvote: () => false, @@ -76,6 +77,7 @@ const createTransactionMock = (wallet: Contracts.IReadWriteWallet) => ], sender: () => transactionFixture.data.sender, timestamp: () => DateTime.make(), + total: () => +transactionFixture.data.amount / 1e8, type: () => "transfer", usesMultiSignature: () => false, wallet: () => wallet, @@ -1342,6 +1344,7 @@ describe("SendTransfer", () => { convertedTotal: () => 0, isConfirmed: () => false, isMultiPayment: () => false, + isReturn: () => false, isSent: () => true, isTransfer: () => true, isUnvote: () => false, @@ -1357,6 +1360,7 @@ describe("SendTransfer", () => { convertedTotal: () => 0, isConfirmed: () => false, isMultiPayment: () => true, + isReturn: () => false, isSent: () => true, isTransfer: () => false, isUnvote: () => false, diff --git a/src/domains/transaction/pages/SendTransfer/__snapshots__/SendTransfer.test.tsx.snap b/src/domains/transaction/pages/SendTransfer/__snapshots__/SendTransfer.test.tsx.snap index d90313a858..40d3c3098b 100644 --- a/src/domains/transaction/pages/SendTransfer/__snapshots__/SendTransfer.test.tsx.snap +++ b/src/domains/transaction/pages/SendTransfer/__snapshots__/SendTransfer.test.tsx.snap @@ -953,7 +953,7 @@ exports[`SendTransfer > should display unconfirmed transactions modal when submi class="whitespace-nowrap text-sm" data-testid="Amount" > - - 400,000.1 DARK + - 400,000 DARK @@ -7376,7 +7376,7 @@ exports[`SendTransfer > should send a single transfer and handle undefined expir class="whitespace-nowrap text-sm" data-testid="Amount" > - - 400,000.1 DARK + - 400,000 DARK @@ -8713,7 +8713,7 @@ exports[`SendTransfer > should send a single transfer and show unconfirmed trans class="whitespace-nowrap text-sm" data-testid="Amount" > - - 400,000.1 DARK + - 400,000 DARK @@ -10604,7 +10604,7 @@ exports[`SendTransfer > should send a single transfer using wallet with encrypti class="whitespace-nowrap text-sm" data-testid="Amount" > - - 400,000.1 DARK + - 400,000 DARK @@ -11941,7 +11941,7 @@ exports[`SendTransfer > should send a single transfer with keyboard 1`] = ` class="whitespace-nowrap text-sm" data-testid="Amount" > - - 400,000.1 DARK + - 400,000 DARK @@ -13278,7 +13278,7 @@ exports[`SendTransfer > should send a single transfer without keyboard 1`] = ` class="whitespace-nowrap text-sm" data-testid="Amount" > - - 400,000.1 DARK + - 400,000 DARK From 1d6f7671d678e58f60fc7e6223d26e857ff8ba1e Mon Sep 17 00:00:00 2001 From: Juan Patricio Marroquin Date: Sun, 10 Nov 2024 21:20:10 -0500 Subject: [PATCH 09/12] fix: unit tests --- .../SendDelegateResignation/SendDelegateResignation.test.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/domains/transaction/pages/SendDelegateResignation/SendDelegateResignation.test.tsx b/src/domains/transaction/pages/SendDelegateResignation/SendDelegateResignation.test.tsx index 9667c814b0..bdfdfdf9e7 100644 --- a/src/domains/transaction/pages/SendDelegateResignation/SendDelegateResignation.test.tsx +++ b/src/domains/transaction/pages/SendDelegateResignation/SendDelegateResignation.test.tsx @@ -65,6 +65,7 @@ const transactionResponse = { isIpfs: () => false, isMultiPayment: () => false, isMultiSignatureRegistration: () => false, + isReturn: () => false, isSent: () => true, isTransfer: () => false, isUnvote: () => false, @@ -74,6 +75,7 @@ const transactionResponse = { recipient: () => transactionFixture.data.recipient, sender: () => transactionFixture.data.sender, timestamp: () => DateTime.make(), + total: () => +transactionFixture.data.amount / 1e8, type: () => "delegateResignation", usesMultiSignature: () => false, wallet: () => wallet, From 442ba227b808e44a4e2c244613bf156cfcd0f0ae Mon Sep 17 00:00:00 2001 From: Juan Patricio Marroquin Date: Sun, 10 Nov 2024 22:07:28 -0500 Subject: [PATCH 10/12] fix: unit tests --- .../transaction/pages/SendTransfer/SendTransfer.Fees.test.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/domains/transaction/pages/SendTransfer/SendTransfer.Fees.test.tsx b/src/domains/transaction/pages/SendTransfer/SendTransfer.Fees.test.tsx index d382e3d935..4ebc2518eb 100644 --- a/src/domains/transaction/pages/SendTransfer/SendTransfer.Fees.test.tsx +++ b/src/domains/transaction/pages/SendTransfer/SendTransfer.Fees.test.tsx @@ -46,6 +46,7 @@ const createTransactionMock = (wallet: Contracts.IReadWriteWallet) => isIpfs: () => false, isMultiPayment: () => false, isMultiSignatureRegistration: () => false, + isReturn: () => false, isSent: () => true, isTransfer: () => true, isUnvote: () => false, @@ -58,6 +59,7 @@ const createTransactionMock = (wallet: Contracts.IReadWriteWallet) => ], sender: () => transactionFixture.data.sender, timestamp: () => DateTime.make(), + total: () => +transactionFixture.data.amount / 1e8, type: () => "transfer", usesMultiSignature: () => false, wallet: () => wallet, From 6aa022fdc58573949c8588233392e2eb3b59dd7f Mon Sep 17 00:00:00 2001 From: Juan Patricio Marroquin Date: Sun, 10 Nov 2024 22:21:52 -0500 Subject: [PATCH 11/12] chore: update snapshots --- .../SendTransfer.Fees.test.tsx.snap | 2921 +++++++++++++++++ 1 file changed, 2921 insertions(+) create mode 100644 src/domains/transaction/pages/SendTransfer/__snapshots__/SendTransfer.Fees.test.tsx.snap diff --git a/src/domains/transaction/pages/SendTransfer/__snapshots__/SendTransfer.Fees.test.tsx.snap b/src/domains/transaction/pages/SendTransfer/__snapshots__/SendTransfer.Fees.test.tsx.snap new file mode 100644 index 0000000000..cdbede24b9 --- /dev/null +++ b/src/domains/transaction/pages/SendTransfer/__snapshots__/SendTransfer.Fees.test.tsx.snap @@ -0,0 +1,2921 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`SendTransfer Fee Handling > should send a single transfer with a high fee by confirming the fee warning 1`] = ` +
    +
    +
    +
    +
    + +
    + +
    + +
    +
    + +
    +
    +
    +
    +
    +
    +
    +
    +
    + + Transaction Confirmed + +
      +
    • +
    • +
    • +
    • +
    +
    +
    + +
    +
    +
    +
    +
    +
    + Transaction ID +
    +
    +
    + 8f913...49877 +
    +
    +
    + + +
    +
    +
    +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    +
    +
    +
    +`; + +exports[`SendTransfer Fee Handling > should send a single transfer with a low fee by confirming the fee warning 1`] = ` +
    +
    +
    +
    +
    + +
    + +
    + +
    +
    + +
    +
    +
    +
    +
    +
    +
    +
    +
    + + Transaction Confirmed + +
      +
    • +
    • +
    • +
    • +
    +
    +
    + +
    +
    +
    +
    +
    +
    + Transaction ID +
    +
    +
    + 8f913...49877 +
    +
    +
    + + +
    +
    +
    +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    +
    +
    +
    +`; From 1a5e1b18979ff0d5b2d5be90d5e41a2e70b8e697 Mon Sep 17 00:00:00 2001 From: Juan Patricio Marroquin Date: Mon, 11 Nov 2024 08:35:10 -0500 Subject: [PATCH 12/12] chore: update snapshots --- .../__snapshots__/NotificationsDropdown.test.tsx.snap | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/components/Notifications/__snapshots__/NotificationsDropdown.test.tsx.snap b/src/app/components/Notifications/__snapshots__/NotificationsDropdown.test.tsx.snap index 21fe4f73e5..dd532e3626 100644 --- a/src/app/components/Notifications/__snapshots__/NotificationsDropdown.test.tsx.snap +++ b/src/app/components/Notifications/__snapshots__/NotificationsDropdown.test.tsx.snap @@ -533,7 +533,7 @@ exports[`Notifications > should open and close transaction details modal 1`] = ` Amount