From a3a9f2f00e663b590c18f70c8e323fed93e2fd07 Mon Sep 17 00:00:00 2001 From: Pedro Figueiredo Date: Thu, 28 Nov 2024 13:30:02 +0000 Subject: [PATCH] wip --- .../tokens/custom-token-send-transfer.spec.js | 5 +- .../tests/transaction/change-assets.spec.js | 2 - .../tests/transaction/edit-gas-fee.spec.js | 14 +- .../tests/transaction/gas-estimates.spec.js | 25 + .../transaction/navigate-transactions.spec.js | 5 +- test/e2e/tests/transaction/send-edit.spec.js | 511 ++++++--- test/e2e/tests/transaction/send-eth.spec.js | 1015 +++++++++++------ .../transaction/send-hex-address.spec.js | 587 ++++++---- .../transaction-flow-section.test.tsx.snap | 2 + .../transaction-flow-section.tsx | 4 +- .../nav/__snapshots__/nav.test.tsx.snap | 1 + 11 files changed, 1423 insertions(+), 748 deletions(-) diff --git a/test/e2e/tests/tokens/custom-token-send-transfer.spec.js b/test/e2e/tests/tokens/custom-token-send-transfer.spec.js index 4c098f945c92..3774af82ae1c 100644 --- a/test/e2e/tests/tokens/custom-token-send-transfer.spec.js +++ b/test/e2e/tests/tokens/custom-token-send-transfer.spec.js @@ -1,6 +1,7 @@ -import { mockedSourcifyTokenSend } from '../confirmations/transactions/erc20-token-send-redesign.spec'; - const { strict: assert } = require('assert'); +const { + mockedSourcifyTokenSend, +} = require('../confirmations/transactions/erc20-token-send-redesign.spec'); const { withFixtures, defaultGanacheOptions, diff --git a/test/e2e/tests/transaction/change-assets.spec.js b/test/e2e/tests/transaction/change-assets.spec.js index 6791b945955c..9764941771b7 100644 --- a/test/e2e/tests/transaction/change-assets.spec.js +++ b/test/e2e/tests/transaction/change-assets.spec.js @@ -1,5 +1,3 @@ -import { it } from 'mocha'; - const { strict: assert } = require('assert'); const { defaultGanacheOptions, diff --git a/test/e2e/tests/transaction/edit-gas-fee.spec.js b/test/e2e/tests/transaction/edit-gas-fee.spec.js index ddab1c87f7fc..490d57201fda 100644 --- a/test/e2e/tests/transaction/edit-gas-fee.spec.js +++ b/test/e2e/tests/transaction/edit-gas-fee.spec.js @@ -119,10 +119,10 @@ describe('Editing Confirm Transaction', function () { await driver.clickElement('[data-testid="edit-gas-fee-item-custom"]'); // enter max fee - await driver.fill('[data-testid="base-fee-input"]', '8.5'); + await driver.fill('[data-testid="base-fee-input"]', '8,5'); // enter priority fee - await driver.fill('[data-testid="priority-fee-input"]', '8.5'); + await driver.fill('[data-testid="priority-fee-input"]', '8,5'); // save default values await driver.clickElement('input[type="checkbox"]'); @@ -363,6 +363,11 @@ describe('Editing Confirm Transaction', function () { text: '0.0008 ETH', }); + await driver.waitForSelector({ + css: '[data-testid="native-currency"]', + text: '$1.44', + }); + // confirms the transaction await driver.clickElement({ text: 'Confirm', tag: 'button' }); @@ -430,6 +435,11 @@ describe('Editing Confirm Transaction', function () { text: '0.0019', }); + await driver.waitForSelector({ + css: '[data-testid="native-currency"]', + text: '$3.15', + }); + // confirms the transaction await driver.clickElement({ text: 'Confirm', tag: 'button' }); diff --git a/test/e2e/tests/transaction/gas-estimates.spec.js b/test/e2e/tests/transaction/gas-estimates.spec.js index 168bc7f54413..77027bc67901 100644 --- a/test/e2e/tests/transaction/gas-estimates.spec.js +++ b/test/e2e/tests/transaction/gas-estimates.spec.js @@ -281,6 +281,11 @@ describe('Gas estimates generated by MetaMask', function () { css: '[data-testid="first-gas-field"]', text: '0.0004 ETH', }); + + await driver.waitForSelector({ + css: '[data-testid="native-currency"]', + text: '$0.75', + }); }, ); }); @@ -323,6 +328,10 @@ describe('Gas estimates generated by MetaMask', function () { css: '[data-testid="first-gas-field"]', text: '0 ETH', }); + await driver.waitForSelector({ + css: '[data-testid="native-currency"]', + text: '$0.07', + }); }, ); }); @@ -362,6 +371,10 @@ describe('Gas estimates generated by MetaMask', function () { css: '[data-testid="first-gas-field"]', text: '0 ETH', }); + await driver.waitForSelector({ + css: '[data-testid="native-currency"]', + text: '$0.07', + }); }, ); }); @@ -396,6 +409,10 @@ describe('Gas estimates generated by MetaMask', function () { css: '[data-testid="first-gas-field"]', text: '0 ETH', }); + await driver.waitForSelector({ + css: '[data-testid="native-currency"]', + text: '$0.07', + }); }, ); }); @@ -442,6 +459,10 @@ describe('Gas estimates generated by MetaMask', function () { css: '[data-testid="first-gas-field"]', text: '0 ETH', }); + await driver.waitForSelector({ + css: '[data-testid="native-currency"]', + text: '$0.07', + }); }, ); }); @@ -471,6 +492,10 @@ describe('Gas estimates generated by MetaMask', function () { css: '[data-testid="first-gas-field"]', text: '0 ETH', }); + await driver.waitForSelector({ + css: '[data-testid="native-currency"]', + text: '$0.07', + }); }, ); }); diff --git a/test/e2e/tests/transaction/navigate-transactions.spec.js b/test/e2e/tests/transaction/navigate-transactions.spec.js index 8004e8873bde..eb8465fb47a7 100644 --- a/test/e2e/tests/transaction/navigate-transactions.spec.js +++ b/test/e2e/tests/transaction/navigate-transactions.spec.js @@ -1,5 +1,6 @@ -import Confirmation from '../../page-objects/pages/confirmations/redesign/confirmation'; - +const { + default: Confirmation, +} = require('../../page-objects/pages/confirmations/redesign/confirmation'); const { createDappTransaction, } = require('../../page-objects/flows/transaction'); diff --git a/test/e2e/tests/transaction/send-edit.spec.js b/test/e2e/tests/transaction/send-edit.spec.js index 8d19d6d071b1..2180d65b3ec4 100644 --- a/test/e2e/tests/transaction/send-edit.spec.js +++ b/test/e2e/tests/transaction/send-edit.spec.js @@ -13,168 +13,357 @@ const { const FixtureBuilder = require('../../fixture-builder'); describe('Editing Confirm Transaction', function () { - it('goes back from confirm page to edit eth value, gas price and gas limit', async function () { - await withFixtures( - { - fixtures: new FixtureBuilder().withConversionRateDisabled().build(), - ganacheOptions: defaultGanacheOptions, - title: this.test.fullTitle(), - }, - async ({ driver }) => { - await unlockWallet(driver); - await tempToggleSettingRedesignedTransactionConfirmations(driver); - await createInternalTransaction(driver); - - await driver.findElement({ - css: '.currency-display-component__text', - text: '1', - }); - - await driver.findElement({ - css: '.currency-display-component__text', - text: '1.000042', - }); - - await driver.clickElement( - '.confirm-page-container-header__back-button', - ); - - const inputAmount = await driver.findElement('input[placeholder="0"]'); - - await inputAmount.press(driver.Key.BACK_SPACE); - await inputAmount.press('2'); - await inputAmount.press('.'); - await inputAmount.press('2'); - - await driver.clickElement({ text: 'Continue', tag: 'button' }); - - await driver.clickElement({ text: 'Edit', tag: 'button' }); - - const [gasLimitInput, gasPriceInput] = await driver.findElements( - 'input[type="number"]', - ); - await gasPriceInput.fill('8'); - await gasLimitInput.fill('100000'); - await driver.clickElement({ text: 'Save', tag: 'button' }); - - // has correct updated value on the confirm screen the transaction - await driver.waitForSelector({ - css: '.currency-display-component__text', - text: '0.0008', - }); - await driver.waitForSelector({ - css: '.currency-display-component__suffix', - text: 'ETH', - }); - - // confirms the transaction - await driver.clickElement({ text: 'Confirm', tag: 'button' }); - - await driver.clickElement( - '[data-testid="account-overview__activity-tab"]', - ); - await driver.wait(async () => { - const confirmedTxes = await driver.findElements( - '.transaction-list__completed-transactions .activity-list-item', - ); - return confirmedTxes.length === 1; - }, 10000); - - const txValues = await driver.findElements( - '[data-testid="transaction-list-item-primary-currency"]', - ); - assert.equal(txValues.length, 1); - assert.ok(/-2.2\s*ETH/u.test(await txValues[0].getText())); - }, - ); + describe('Old confirmation screens', function () { + it('goes back from confirm page to edit eth value, gas price and gas limit', async function () { + await withFixtures( + { + fixtures: new FixtureBuilder().withConversionRateDisabled().build(), + ganacheOptions: defaultGanacheOptions, + title: this.test.fullTitle(), + }, + async ({ driver }) => { + await unlockWallet(driver); + await tempToggleSettingRedesignedTransactionConfirmations(driver); + await createInternalTransaction(driver); + + await driver.findElement({ + css: '.currency-display-component__text', + text: '1', + }); + + await driver.findElement({ + css: '.currency-display-component__text', + text: '1.000042', + }); + + await driver.clickElement( + '.confirm-page-container-header__back-button', + ); + + const inputAmount = await driver.findElement( + 'input[placeholder="0"]', + ); + + await inputAmount.press(driver.Key.BACK_SPACE); + await inputAmount.press('2'); + await inputAmount.press('.'); + await inputAmount.press('2'); + + await driver.clickElement({ text: 'Continue', tag: 'button' }); + + await driver.clickElement({ text: 'Edit', tag: 'button' }); + + const [gasLimitInput, gasPriceInput] = await driver.findElements( + 'input[type="number"]', + ); + await gasPriceInput.fill('8'); + await gasLimitInput.fill('100000'); + await driver.clickElement({ text: 'Save', tag: 'button' }); + + // has correct updated value on the confirm screen the transaction + await driver.waitForSelector({ + css: '.currency-display-component__text', + text: '0.0008', + }); + await driver.waitForSelector({ + css: '.currency-display-component__suffix', + text: 'ETH', + }); + + // confirms the transaction + await driver.clickElement({ text: 'Confirm', tag: 'button' }); + + await driver.clickElement( + '[data-testid="account-overview__activity-tab"]', + ); + await driver.wait(async () => { + const confirmedTxes = await driver.findElements( + '.transaction-list__completed-transactions .activity-list-item', + ); + return confirmedTxes.length === 1; + }, 10000); + + const txValues = await driver.findElements( + '[data-testid="transaction-list-item-primary-currency"]', + ); + assert.equal(txValues.length, 1); + assert.ok(/-2.2\s*ETH/u.test(await txValues[0].getText())); + }, + ); + }); + + it('goes back from confirm page to edit eth value, baseFee, priorityFee and gas limit - 1559 V2', async function () { + await withFixtures( + { + fixtures: new FixtureBuilder().withConversionRateDisabled().build(), + ganacheOptions: generateGanacheOptions({ hardfork: 'london' }), + title: this.test.fullTitle(), + }, + async ({ driver }) => { + await unlockWallet(driver); + await tempToggleSettingRedesignedTransactionConfirmations(driver); + + await createInternalTransaction(driver); + + await driver.findElement({ + css: '.currency-display-component__text', + text: '1', + }); + + await driver.findElement({ + css: '.currency-display-component__text', + text: '1.00043983', + }); + + await driver.clickElement( + '.confirm-page-container-header__back-button', + ); + + const inputAmount = await driver.findElement( + 'input[placeholder="0"]', + ); + + await inputAmount.press(driver.Key.BACK_SPACE); + await inputAmount.press('2'); + await inputAmount.press('.'); + await inputAmount.press('2'); + + await driver.clickElement({ text: 'Continue', tag: 'button' }); + + // open gas fee popover + await driver.clickElement('[data-testid="edit-gas-fee-icon"]'); + + await driver.clickElement('[data-testid="edit-gas-fee-item-custom"]'); + + // enter max fee + await driver.fill('[data-testid="base-fee-input"]', '8'); + + // enter priority fee + await driver.fill('[data-testid="priority-fee-input"]', '8'); + + // edit gas limit + await driver.clickElement('[data-testid="advanced-gas-fee-edit"]'); + await driver.fill('[data-testid="gas-limit-input"]', '100000'); + + // save default values + await driver.clickElement('input[type="checkbox"]'); + + // Submit gas fee changes + await driver.clickElement({ text: 'Save', tag: 'button' }); + + // has correct updated value on the confirm screen the transaction + await driver.waitForSelector({ + css: '.currency-display-component__text', + text: '0.0008', + }); + await driver.waitForSelector({ + css: '.currency-display-component__suffix', + text: 'ETH', + }); + + // confirms the transaction + await driver.clickElement({ text: 'Confirm', tag: 'button' }); + + await driver.clickElement( + '[data-testid="account-overview__activity-tab"]', + ); + await driver.wait(async () => { + const confirmedTxes = await driver.findElements( + '.transaction-list__completed-transactions .activity-list-item', + ); + return confirmedTxes.length === 1; + }, 10000); + + const txValues = await driver.findElements( + '[data-testid="transaction-list-item-primary-currency"]', + ); + assert.equal(txValues.length, 1); + assert.ok(/-2.2\s*ETH/u.test(await txValues[0].getText())); + }, + ); + }); }); - it('goes back from confirm page to edit eth value, baseFee, priorityFee and gas limit - 1559 V2', async function () { - await withFixtures( - { - fixtures: new FixtureBuilder().withConversionRateDisabled().build(), - ganacheOptions: generateGanacheOptions({ hardfork: 'london' }), - title: this.test.fullTitle(), - }, - async ({ driver }) => { - await unlockWallet(driver); - await tempToggleSettingRedesignedTransactionConfirmations(driver); - - await createInternalTransaction(driver); - - await driver.findElement({ - css: '.currency-display-component__text', - text: '1', - }); - - await driver.findElement({ - css: '.currency-display-component__text', - text: '1.00043983', - }); - - await driver.clickElement( - '.confirm-page-container-header__back-button', - ); - - const inputAmount = await driver.findElement('input[placeholder="0"]'); - - await inputAmount.press(driver.Key.BACK_SPACE); - await inputAmount.press('2'); - await inputAmount.press('.'); - await inputAmount.press('2'); - - await driver.clickElement({ text: 'Continue', tag: 'button' }); - - // open gas fee popover - await driver.clickElement('[data-testid="edit-gas-fee-icon"]'); - - await driver.clickElement('[data-testid="edit-gas-fee-item-custom"]'); - - // enter max fee - await driver.fill('[data-testid="base-fee-input"]', '8'); - - // enter priority fee - await driver.fill('[data-testid="priority-fee-input"]', '8'); - - // edit gas limit - await driver.clickElement('[data-testid="advanced-gas-fee-edit"]'); - await driver.fill('[data-testid="gas-limit-input"]', '100000'); - - // save default values - await driver.clickElement('input[type="checkbox"]'); - - // Submit gas fee changes - await driver.clickElement({ text: 'Save', tag: 'button' }); - - // has correct updated value on the confirm screen the transaction - await driver.waitForSelector({ - css: '.currency-display-component__text', - text: '0.0008', - }); - await driver.waitForSelector({ - css: '.currency-display-component__suffix', - text: 'ETH', - }); - - // confirms the transaction - await driver.clickElement({ text: 'Confirm', tag: 'button' }); - - await driver.clickElement( - '[data-testid="account-overview__activity-tab"]', - ); - await driver.wait(async () => { - const confirmedTxes = await driver.findElements( - '.transaction-list__completed-transactions .activity-list-item', - ); - return confirmedTxes.length === 1; - }, 10000); - - const txValues = await driver.findElements( - '[data-testid="transaction-list-item-primary-currency"]', - ); - assert.equal(txValues.length, 1); - assert.ok(/-2.2\s*ETH/u.test(await txValues[0].getText())); - }, - ); + describe('Redesigned confirmation screens', function () { + it('goes back from confirm page to edit eth value, gas price and gas limit', async function () { + await withFixtures( + { + fixtures: new FixtureBuilder().withConversionRateDisabled().build(), + ganacheOptions: defaultGanacheOptions, + title: this.test.fullTitle(), + }, + async ({ driver }) => { + await unlockWallet(driver); + + await createInternalTransaction(driver); + + await driver.findElement({ + css: 'h2', + text: '1 ETH', + }); + + await driver.findElement({ + css: '[data-testid="first-gas-field"]', + text: '0 ETH', + }); + + await driver.findElement({ + css: '[data-testid="native-currency"]', + text: '$0.07', + }); + + await driver.clickElement( + '[data-testid="wallet-initiated-header-back-button"]', + ); + + const inputAmount = await driver.findElement( + 'input[placeholder="0"]', + ); + + await inputAmount.press(driver.Key.BACK_SPACE); + await inputAmount.press('2'); + await inputAmount.press('.'); + await inputAmount.press('2'); + + await driver.clickElement({ text: 'Continue', tag: 'button' }); + + await driver.clickElement('[data-testid="edit-gas-fee-icon"]'); + + const [gasLimitInput, gasPriceInput] = await driver.findElements( + 'input[type="number"]', + ); + await gasPriceInput.fill('8'); + await gasLimitInput.fill('100000'); + await driver.clickElement({ text: 'Save', tag: 'button' }); + + // has correct updated value on the confirm screen the transaction + await driver.findElement({ + css: '[data-testid="first-gas-field"]', + text: '0.0008 ETH', + }); + + await driver.findElement({ + css: '[data-testid="native-currency"]', + text: '$1.36', + }); + + // confirms the transaction + await driver.clickElement({ text: 'Confirm', tag: 'button' }); + + await driver.clickElement( + '[data-testid="account-overview__activity-tab"]', + ); + await driver.wait(async () => { + const confirmedTxes = await driver.findElements( + '.transaction-list__completed-transactions .activity-list-item', + ); + return confirmedTxes.length === 1; + }, 10000); + + const txValues = await driver.findElements( + '[data-testid="transaction-list-item-primary-currency"]', + ); + assert.equal(txValues.length, 1); + assert.ok(/-2.2\s*ETH/u.test(await txValues[0].getText())); + }, + ); + }); + + it('goes back from confirm page to edit eth value, baseFee, priorityFee and gas limit - 1559 V2', async function () { + await withFixtures( + { + fixtures: new FixtureBuilder().withConversionRateDisabled().build(), + ganacheOptions: generateGanacheOptions({ hardfork: 'london' }), + title: this.test.fullTitle(), + }, + async ({ driver }) => { + await unlockWallet(driver); + // await tempToggleSettingRedesignedTransactionConfirmations(driver); + + await createInternalTransaction(driver); + + await driver.findElement({ + css: 'h2', + text: '1 ETH', + }); + + await driver.findElement({ + css: '[data-testid="first-gas-field"]', + text: '0.0004 ETH', + }); + + await driver.findElement({ + css: '[data-testid="native-currency"]', + text: '$0.75', + }); + + await driver.clickElement( + '[data-testid="wallet-initiated-header-back-button"]', + ); + + const inputAmount = await driver.findElement( + 'input[placeholder="0"]', + ); + + await inputAmount.press(driver.Key.BACK_SPACE); + await inputAmount.press('2'); + await inputAmount.press('.'); + await inputAmount.press('2'); + + await driver.clickElement({ text: 'Continue', tag: 'button' }); + + // open gas fee popover + await driver.clickElement('[data-testid="edit-gas-fee-icon"]'); + + await driver.clickElement('[data-testid="edit-gas-fee-item-custom"]'); + + // enter max fee + await driver.fill('[data-testid="base-fee-input"]', '8'); + + // enter priority fee + await driver.fill('[data-testid="priority-fee-input"]', '8'); + + // edit gas limit + await driver.clickElement('[data-testid="advanced-gas-fee-edit"]'); + await driver.fill('[data-testid="gas-limit-input"]', '100000'); + + // save default values + await driver.clickElement('input[type="checkbox"]'); + + // Submit gas fee changes + await driver.clickElement({ text: 'Save', tag: 'button' }); + + // has correct updated value on the confirm screen the transaction + await driver.findElement({ + css: '[data-testid="first-gas-field"]', + text: '0.0008 ETH', + }); + + await driver.findElement({ + css: '[data-testid="native-currency"]', + text: '$1.36', + }); + + // confirms the transaction + await driver.clickElement({ text: 'Confirm', tag: 'button' }); + + await driver.clickElement( + '[data-testid="account-overview__activity-tab"]', + ); + await driver.wait(async () => { + const confirmedTxes = await driver.findElements( + '.transaction-list__completed-transactions .activity-list-item', + ); + return confirmedTxes.length === 1; + }, 10000); + + const txValues = await driver.findElements( + '[data-testid="transaction-list-item-primary-currency"]', + ); + assert.equal(txValues.length, 1); + assert.ok(/-2.2\s*ETH/u.test(await txValues[0].getText())); + }, + ); + }); }); }); diff --git a/test/e2e/tests/transaction/send-eth.spec.js b/test/e2e/tests/transaction/send-eth.spec.js index 9ee1b58dc170..7bffb3f1cde1 100644 --- a/test/e2e/tests/transaction/send-eth.spec.js +++ b/test/e2e/tests/transaction/send-eth.spec.js @@ -14,244 +14,398 @@ const { const FixtureBuilder = require('../../fixture-builder'); describe('Send ETH', function () { - describe('from inside MetaMask', function () { - it('finds the transaction in the transactions list using default gas', async function () { - await withFixtures( - { - fixtures: new FixtureBuilder().build(), - ganacheOptions: defaultGanacheOptions, - title: this.test.fullTitle(), - }, - async ({ driver, ganacheServer }) => { - await logInWithBalanceValidation(driver, ganacheServer); - - await openActionMenuAndStartSendFlow(driver); - - await driver.fill( - 'input[placeholder="Enter public address (0x) or domain name"]', - '0x2f318C334780961FB129D2a6c30D0763d9a5C970', - ); + describe('Old confirmation screens', function () { + describe('from inside MetaMask', function () { + /* eslint-disable-next-line mocha/max-top-level-suites */ + it('finds the transaction in the transactions list using advanced gas modal', async function () { + await withFixtures( + { + fixtures: new FixtureBuilder().build(), + ganacheOptions: defaultGanacheOptions, + defaultGanacheOptions, + title: this.test.fullTitle(), + }, + async ({ driver }) => { + await unlockWallet(driver); - const inputAmount = await driver.findElement( - 'input[placeholder="0"]', - ); + await tempToggleSettingRedesignedTransactionConfirmations(driver); - await inputAmount.press('1'); - await inputAmount.press('0'); - await inputAmount.press('0'); - await inputAmount.press('0'); + await driver.delay(1000); - await driver.findElement({ - css: '[data-testid="send-page-amount-error"]', - text: '. Insufficient funds.', - }); + await openActionMenuAndStartSendFlow(driver); + await driver.fill( + 'input[placeholder="Enter public address (0x) or domain name"]', + '0x2f318C334780961FB129D2a6c30D0763d9a5C970', + ); - await inputAmount.press(driver.Key.BACK_SPACE); - await inputAmount.press(driver.Key.BACK_SPACE); - await inputAmount.press(driver.Key.BACK_SPACE); + const inputAmount = await driver.findElement( + 'input[placeholder="0"]', + ); + await inputAmount.press('1'); - await driver.assertElementNotPresent('.send-v2__error-amount', { - waitAtLeastGuard: 100, // A waitAtLeastGuard of 100ms is the best choice here - }); + const inputValue = await inputAmount.getProperty('value'); + assert.equal(inputValue, '1'); - const amountMax = await driver.findClickableElement( - '[data-testid="max-clear-button"]', - ); - await amountMax.click(); + // Continue to next screen + await driver.clickElement({ text: 'Continue', tag: 'button' }); - let inputValue = await inputAmount.getProperty('value'); + await driver.delay(1000); + const transactionAmounts = await driver.findElements( + '.currency-display-component__text', + ); + const transactionAmount = transactionAmounts[0]; + assert.equal(await transactionAmount.getText(), '1'); - assert(Number(inputValue) > 24); + await driver.clickElement({ text: 'Confirm', tag: 'button' }); - await amountMax.click(); + await driver.wait(async () => { + const confirmedTxes = await driver.findElements( + '.transaction-list__completed-transactions .activity-list-item', + ); + return confirmedTxes.length === 1; + }, 10000); - assert.equal(await inputAmount.isEnabled(), true); + await driver.waitForSelector({ + css: '[data-testid="transaction-list-item-primary-currency"]', + text: '-1 ETH', + }); + }, + ); + }); - await inputAmount.fill('1'); + describe('from dapp using advanced gas controls', function () { + it('should display the correct gas price on the legacy transaction', async function () { + await withFixtures( + { + dapp: true, + fixtures: new FixtureBuilder() + .withPermissionControllerConnectedToTestDapp() + .build(), + ganacheOptions: defaultGanacheOptions, + defaultGanacheOptions, + title: this.test.fullTitle(), + }, + async ({ driver }) => { + await unlockWallet(driver); + + await tempToggleSettingRedesignedTransactionConfirmations(driver); + + // initiates a send from the dapp + await openDapp(driver); + await driver.clickElement({ text: 'Send', tag: 'button' }); + const windowHandles = await driver.waitUntilXWindowHandles(3); + const extension = windowHandles[0]; + await driver.switchToWindowWithTitle( + WINDOW_TITLES.Dialog, + windowHandles, + ); + + await driver.assertElementNotPresent( + { text: 'Data', tag: 'li' }, + { findElementGuard: { text: 'Estimated gas fee', tag: 'h6' } }, // make sure the Dialog has loaded + ); + + await driver.clickElement({ text: 'Edit', tag: 'button' }); + await driver.waitForSelector({ + text: '0.00021 ETH', + }); + await driver.clickElement({ + text: 'Edit suggested gas fee', + tag: 'button', + }); + await driver.waitForSelector({ + text: 'Edit priority', + tag: 'header', + }); + await editGasFeeForm(driver, '21000', '100'); + await driver.waitForSelector({ + css: '.transaction-detail-item:nth-of-type(1) h6:nth-of-type(2)', + text: '0.0021 ETH', + }); + await driver.clickElement({ text: 'Confirm', tag: 'button' }); + await driver.waitUntilXWindowHandles(2); + await driver.switchToWindow(extension); + + // finds the transaction in the transactions list + await driver.clickElement( + '[data-testid="account-overview__activity-tab"]', + ); + await driver.waitForSelector( + '.transaction-list__completed-transactions .activity-list-item:nth-of-type(1)', + ); + await driver.waitForSelector({ + css: '[data-testid="transaction-list-item-primary-currency"]', + text: '-0 ETH', + }); + + // the transaction has the expected gas price + await driver.clickElement( + '[data-testid="transaction-list-item-primary-currency"]', + ); + await driver.waitForSelector({ + css: '[data-testid="transaction-breakdown__gas-price"]', + text: '100', + }); + }, + ); + }); + + it('should display correct gas values for EIP-1559 transaction', async function () { + await withFixtures( + { + dapp: true, + fixtures: new FixtureBuilder() + .withPermissionControllerConnectedToTestDapp() + .build(), + ganacheOptions: { + ...defaultGanacheOptions, + hardfork: 'london', + }, + title: this.test.fullTitle(), + }, + async ({ driver }) => { + await unlockWallet(driver); + + await tempToggleSettingRedesignedTransactionConfirmations(driver); + + // initiates a transaction from the dapp + await openDapp(driver); + await driver.clickElement({ + text: 'Create Token', + tag: 'button', + }); + const windowHandles = await driver.waitUntilXWindowHandles(3); + + const extension = windowHandles[0]; + await driver.switchToWindowWithTitle( + WINDOW_TITLES.Dialog, + windowHandles, + ); + + await driver.assertElementNotPresent( + { text: 'Data', tag: 'li' }, + { findElementGuard: { text: 'Estimated fee' } }, // make sure the Dialog has loaded + ); + + await driver.clickElement('[data-testid="edit-gas-fee-icon"]'); + await driver.clickElement( + '[data-testid="edit-gas-fee-item-custom"]', + ); + + const baseFeeInput = await driver.findElement( + '[data-testid="base-fee-input"]', + ); + await baseFeeInput.fill('25'); + const priorityFeeInput = await driver.findElement( + '[data-testid="priority-fee-input"]', + ); + await priorityFeeInput.fill('1'); + + await driver.clickElement({ text: 'Save', tag: 'button' }); + + await driver.waitForSelector({ + css: '.currency-display-component__text', + text: '0.0550741', + }); + + await driver.clickElement({ text: 'Confirm', tag: 'button' }); + await driver.waitUntilXWindowHandles(2); + await driver.switchToWindow(extension); + + // Identify the transaction in the transactions list + await driver.waitForSelector( + '[data-testid="eth-overview__primary-currency"]', + ); + + await driver.clickElement( + '[data-testid="account-overview__activity-tab"]', + ); + await driver.waitForSelector( + '.transaction-list__completed-transactions .activity-list-item:nth-of-type(1)', + ); + await driver.waitForSelector({ + css: '[data-testid="transaction-list-item-primary-currency"]', + text: '-0 ETH', + }); + + // the transaction has the expected gas value + await driver.clickElement( + '[data-testid="transaction-list-item-primary-currency"]', + ); + + await driver.waitForSelector({ + xpath: "//div[contains(text(), 'Base fee')]", + }); + + const allFeeValues = await driver.findElements( + '.currency-display-component__text', + ); + + /** + * Below lines check that fee values are numeric. + * Because these values change for every e2e run, + * It's better to just check that the values are there and are numeric + */ + assert.equal(allFeeValues.length > 0, true); + + allFeeValues.forEach(async (feeValue) => { + assert.equal(/\d+\.?\d*/u.test(await feeValue.getText()), true); + }); + }, + ); + }); + }); - inputValue = await inputAmount.getProperty('value'); - assert.equal(inputValue, '1'); + describe('to non-contract address with data that matches ERC20 transfer data signature', function () { + it('renders the correct recipient on the confirmation screen', async function () { + await withFixtures( + { + fixtures: new FixtureBuilder() + .withPreferencesController({ + featureFlags: { + sendHexData: true, + }, + }) + .withPreferencesControllerPetnamesDisabled() + .build(), + ganacheOptions: defaultGanacheOptions, + title: this.test.fullTitle(), + }, + async ({ driver }) => { + await unlockWallet(driver); + + await tempToggleSettingRedesignedTransactionConfirmations(driver); + + await driver.assertElementNotPresent('.loading-overlay__spinner'); + const balance = await driver.findElement( + '[data-testid="eth-overview__primary-currency"]', + ); + assert.ok(/^[\d.]+\sETH$/u.test(await balance.getText())); + + await openActionMenuAndStartSendFlow(driver); + + await driver.fill( + 'input[placeholder="Enter public address (0x) or domain name"]', + '0xc427D562164062a23a5cFf596A4a3208e72Acd28', + ); + + await driver.fill( + 'textarea[placeholder="Optional', + '0xa9059cbb0000000000000000000000002f318C334780961FB129D2a6c30D0763d9a5C970000000000000000000000000000000000000000000000000000000000000000a', + ); + + await driver.findClickableElement({ + text: 'Continue', + tag: 'button', + }); + await driver.clickElement({ text: 'Continue', tag: 'button' }); + + await driver.findClickableElement( + '[data-testid="sender-to-recipient__name"]', + ); + await driver.clickElement( + '[data-testid="sender-to-recipient__name"]', + ); + + const recipientAddress = await driver.findElements({ + text: '0xc427D562164062a23a5cFf596A4a3208e72Acd28', + }); + + assert.equal(recipientAddress.length, 1); + }, + ); + }); + }); + }); + }); - // Continue to next screen - await driver.clickElement({ text: 'Continue', tag: 'button' }); + describe('Redesigned confirmation screens', function () { + describe('from inside MetaMask', function () { + it('finds the transaction in the transactions list using default gas', async function () { + await withFixtures( + { + fixtures: new FixtureBuilder().build(), + ganacheOptions: defaultGanacheOptions, + title: this.test.fullTitle(), + }, + async ({ driver, ganacheServer }) => { + await logInWithBalanceValidation(driver, ganacheServer); - await driver.clickElement({ text: 'Confirm', tag: 'button' }); + await openActionMenuAndStartSendFlow(driver); - await driver.clickElement( - '[data-testid="account-overview__activity-tab"]', - ); - await driver.wait(async () => { - const confirmedTxes = await driver.findElements( - '.transaction-list__completed-transactions .activity-list-item', + await driver.fill( + 'input[placeholder="Enter public address (0x) or domain name"]', + '0x2f318C334780961FB129D2a6c30D0763d9a5C970', ); - return confirmedTxes.length === 1; - }, 10000); - - await driver.waitForSelector({ - css: '[data-testid="transaction-list-item-primary-currency"]', - text: '-1 ETH', - }); - }, - ); - }); - - /* eslint-disable-next-line mocha/max-top-level-suites */ - it('finds the transaction in the transactions list using advanced gas modal', async function () { - await withFixtures( - { - fixtures: new FixtureBuilder().build(), - ganacheOptions: defaultGanacheOptions, - defaultGanacheOptions, - title: this.test.fullTitle(), - }, - async ({ driver }) => { - await unlockWallet(driver); - - await tempToggleSettingRedesignedTransactionConfirmations(driver); - - await driver.delay(1000); - - await openActionMenuAndStartSendFlow(driver); - await driver.fill( - 'input[placeholder="Enter public address (0x) or domain name"]', - '0x2f318C334780961FB129D2a6c30D0763d9a5C970', - ); - const inputAmount = await driver.findElement( - 'input[placeholder="0"]', - ); - await inputAmount.press('1'); + const inputAmount = await driver.findElement( + 'input[placeholder="0"]', + ); - const inputValue = await inputAmount.getProperty('value'); - assert.equal(inputValue, '1'); + await inputAmount.press('1'); + await inputAmount.press('0'); + await inputAmount.press('0'); + await inputAmount.press('0'); - // Continue to next screen - await driver.clickElement({ text: 'Continue', tag: 'button' }); + await driver.findElement({ + css: '[data-testid="send-page-amount-error"]', + text: '. Insufficient funds.', + }); - await driver.delay(1000); - const transactionAmounts = await driver.findElements( - '.currency-display-component__text', - ); - const transactionAmount = transactionAmounts[0]; - assert.equal(await transactionAmount.getText(), '1'); + await inputAmount.press(driver.Key.BACK_SPACE); + await inputAmount.press(driver.Key.BACK_SPACE); + await inputAmount.press(driver.Key.BACK_SPACE); - await driver.clickElement({ text: 'Confirm', tag: 'button' }); + await driver.assertElementNotPresent('.send-v2__error-amount', { + waitAtLeastGuard: 100, // A waitAtLeastGuard of 100ms is the best choice here + }); - await driver.wait(async () => { - const confirmedTxes = await driver.findElements( - '.transaction-list__completed-transactions .activity-list-item', + const amountMax = await driver.findClickableElement( + '[data-testid="max-clear-button"]', ); - return confirmedTxes.length === 1; - }, 10000); - - await driver.waitForSelector({ - css: '[data-testid="transaction-list-item-primary-currency"]', - text: '-1 ETH', - }); - }, - ); - }); + await amountMax.click(); - it('finds the transaction in the transactions list when sending to a Multisig Address', async function () { - const smartContract = SMART_CONTRACTS.MULTISIG; - await withFixtures( - { - fixtures: new FixtureBuilder().build(), - ganacheOptions: { - ...defaultGanacheOptions, - hardfork: 'london', - }, - smartContract, - title: this.test.fullTitle(), - }, - async ({ driver, contractRegistry, ganacheServer }) => { - const contractAddress = await contractRegistry.getContractAddress( - smartContract, - ); - await logInWithBalanceValidation(driver, ganacheServer); + let inputValue = await inputAmount.getProperty('value'); - // Wait for balance to load - await driver.delay(500); + assert(Number(inputValue) > 24); - await driver.clickElement('[data-testid="eth-overview-send"]'); - await driver.fill( - 'input[placeholder="Enter public address (0x) or domain name"]', - contractAddress, - ); + await amountMax.click(); - const inputAmount = await driver.findElement( - 'input[placeholder="0"]', - ); - await inputAmount.press('1'); - - // Continue to next screen - await driver.clickElement({ text: 'Continue', tag: 'button' }); - await driver.clickElement({ text: 'Confirm', tag: 'button' }); + assert.equal(await inputAmount.isEnabled(), true); - // Go back to home screen to check txn - const balance = await driver.findElement( - '[data-testid="eth-overview__primary-currency"]', - ); + await inputAmount.fill('1'); - assert.ok(/^[\d.]+\sETH$/u.test(await balance.getText())); + inputValue = await inputAmount.getProperty('value'); + assert.equal(inputValue, '1'); - await driver.clickElement( - '[data-testid="account-overview__activity-tab"]', - ); + // Continue to next screen + await driver.clickElement({ text: 'Continue', tag: 'button' }); - await driver.findElement( - '.transaction-list__completed-transactions .activity-list-item', - ); + await driver.clickElement({ text: 'Confirm', tag: 'button' }); - // The previous findElement already serves as the guard here for the assertElementNotPresent - await driver.assertElementNotPresent( - '.transaction-status-label--failed', - ); - }, - ); - }); + await driver.clickElement( + '[data-testid="account-overview__activity-tab"]', + ); + await driver.wait(async () => { + const confirmedTxes = await driver.findElements( + '.transaction-list__completed-transactions .activity-list-item', + ); + return confirmedTxes.length === 1; + }, 10000); - it('shows no error when cancel transaction when sending via QR code', async function () { - await withFixtures( - { - fixtures: new FixtureBuilder().build(), - ganacheOptions: defaultGanacheOptions, - title: this.test.fullTitle(), - }, - async ({ driver }) => { - await unlockWallet(driver); - - await driver.assertElementNotPresent('.loading-overlay__spinner'); - const balance = await driver.findElement( - '[data-testid="eth-overview__primary-currency"]', - ); - assert.ok(/^[\d.]+\sETH$/u.test(await balance.getText())); - - await openActionMenuAndStartSendFlow(driver); - // choose to scan via QR code - await driver.clickElement('[data-testid="ens-qr-scan-button"]'); - await driver.findVisibleElement('[data-testid="qr-scanner-modal"]'); - // cancel action will close the dialog and shut down camera initialization - await driver.waitForSelector({ - css: '.qr-scanner__error', - text: "We couldn't access your camera. Please give it another try.", - }); - await driver.clickElement({ text: 'Cancel', tag: 'button' }); - await driver.assertElementNotPresent( - '[data-testid="qr-scanner-modal"]', - ); - }, - ); - }); + await driver.waitForSelector({ + css: '[data-testid="transaction-list-item-primary-currency"]', + text: '-1 ETH', + }); + }, + ); + }); - describe('from dapp using advanced gas controls', function () { - it('should display the correct gas price on the legacy transaction', async function () { + /* eslint-disable-next-line mocha/max-top-level-suites */ + it('finds the transaction in the transactions list using advanced gas modal', async function () { await withFixtures( { - dapp: true, - fixtures: new FixtureBuilder() - .withPermissionControllerConnectedToTestDapp() - .build(), + fixtures: new FixtureBuilder().build(), ganacheOptions: defaultGanacheOptions, defaultGanacheOptions, title: this.test.fullTitle(), @@ -259,191 +413,119 @@ describe('Send ETH', function () { async ({ driver }) => { await unlockWallet(driver); - await tempToggleSettingRedesignedTransactionConfirmations(driver); + await driver.delay(1000); - // initiates a send from the dapp - await openDapp(driver); - await driver.clickElement({ text: 'Send', tag: 'button' }); - const windowHandles = await driver.waitUntilXWindowHandles(3); - const extension = windowHandles[0]; - await driver.switchToWindowWithTitle( - WINDOW_TITLES.Dialog, - windowHandles, + await openActionMenuAndStartSendFlow(driver); + await driver.fill( + 'input[placeholder="Enter public address (0x) or domain name"]', + '0x2f318C334780961FB129D2a6c30D0763d9a5C970', ); - await driver.assertElementNotPresent( - { text: 'Data', tag: 'li' }, - { findElementGuard: { text: 'Estimated gas fee', tag: 'h6' } }, // make sure the Dialog has loaded + const inputAmount = await driver.findElement( + 'input[placeholder="0"]', ); + await inputAmount.press('1'); - await driver.clickElement({ text: 'Edit', tag: 'button' }); - await driver.waitForSelector({ - text: '0.00021 ETH', - }); - await driver.clickElement({ - text: 'Edit suggested gas fee', - tag: 'button', - }); - await driver.waitForSelector({ - text: 'Edit priority', - tag: 'header', - }); - await editGasFeeForm(driver, '21000', '100'); - await driver.waitForSelector({ - css: '.transaction-detail-item:nth-of-type(1) h6:nth-of-type(2)', - text: '0.0021 ETH', + const inputValue = await inputAmount.getProperty('value'); + assert.equal(inputValue, '1'); + + // Continue to next screen + await driver.clickElement({ text: 'Continue', tag: 'button' }); + + await driver.delay(1000); + + // Transaction Amount + await driver.findElement({ + css: 'h2', + text: '1 ETH', }); + await driver.clickElement({ text: 'Confirm', tag: 'button' }); - await driver.waitUntilXWindowHandles(2); - await driver.switchToWindow(extension); - // finds the transaction in the transactions list - await driver.clickElement( - '[data-testid="account-overview__activity-tab"]', - ); - await driver.waitForSelector( - '.transaction-list__completed-transactions .activity-list-item:nth-of-type(1)', - ); - await driver.waitForSelector({ - css: '[data-testid="transaction-list-item-primary-currency"]', - text: '-0 ETH', - }); + await driver.wait(async () => { + const confirmedTxes = await driver.findElements( + '.transaction-list__completed-transactions .activity-list-item', + ); + return confirmedTxes.length === 1; + }, 10000); - // the transaction has the expected gas price - await driver.clickElement( - '[data-testid="transaction-list-item-primary-currency"]', - ); await driver.waitForSelector({ - css: '[data-testid="transaction-breakdown__gas-price"]', - text: '100', + css: '[data-testid="transaction-list-item-primary-currency"]', + text: '-1 ETH', }); }, ); }); - it('should display correct gas values for EIP-1559 transaction', async function () { + it('finds the transaction in the transactions list when sending to a Multisig Address', async function () { + const smartContract = SMART_CONTRACTS.MULTISIG; await withFixtures( { - dapp: true, - fixtures: new FixtureBuilder() - .withPermissionControllerConnectedToTestDapp() - .build(), + fixtures: new FixtureBuilder().build(), ganacheOptions: { ...defaultGanacheOptions, hardfork: 'london', }, + smartContract, title: this.test.fullTitle(), }, - async ({ driver }) => { - await unlockWallet(driver); - - await tempToggleSettingRedesignedTransactionConfirmations(driver); - - // initiates a transaction from the dapp - await openDapp(driver); - await driver.clickElement({ text: 'Create Token', tag: 'button' }); - const windowHandles = await driver.waitUntilXWindowHandles(3); - - const extension = windowHandles[0]; - await driver.switchToWindowWithTitle( - WINDOW_TITLES.Dialog, - windowHandles, + async ({ driver, contractRegistry, ganacheServer }) => { + const contractAddress = await contractRegistry.getContractAddress( + smartContract, ); + await logInWithBalanceValidation(driver, ganacheServer); - await driver.assertElementNotPresent( - { text: 'Data', tag: 'li' }, - { findElementGuard: { text: 'Estimated fee' } }, // make sure the Dialog has loaded - ); + // Wait for balance to load + await driver.delay(500); - await driver.clickElement('[data-testid="edit-gas-fee-icon"]'); - await driver.clickElement( - '[data-testid="edit-gas-fee-item-custom"]', + await driver.clickElement('[data-testid="eth-overview-send"]'); + await driver.fill( + 'input[placeholder="Enter public address (0x) or domain name"]', + contractAddress, ); - const baseFeeInput = await driver.findElement( - '[data-testid="base-fee-input"]', - ); - await baseFeeInput.fill('25'); - const priorityFeeInput = await driver.findElement( - '[data-testid="priority-fee-input"]', + const inputAmount = await driver.findElement( + 'input[placeholder="0"]', ); - await priorityFeeInput.fill('1'); - - await driver.clickElement({ text: 'Save', tag: 'button' }); - - await driver.waitForSelector({ - css: '.currency-display-component__text', - text: '0.0550741', - }); + await inputAmount.press('1'); + // Continue to next screen + await driver.clickElement({ text: 'Continue', tag: 'button' }); await driver.clickElement({ text: 'Confirm', tag: 'button' }); - await driver.waitUntilXWindowHandles(2); - await driver.switchToWindow(extension); - // Identify the transaction in the transactions list - await driver.waitForSelector( + // Go back to home screen to check txn + const balance = await driver.findElement( '[data-testid="eth-overview__primary-currency"]', ); + assert.ok(/^[\d.]+\sETH$/u.test(await balance.getText())); + await driver.clickElement( '[data-testid="account-overview__activity-tab"]', ); - await driver.waitForSelector( - '.transaction-list__completed-transactions .activity-list-item:nth-of-type(1)', - ); - await driver.waitForSelector({ - css: '[data-testid="transaction-list-item-primary-currency"]', - text: '-0 ETH', - }); - // the transaction has the expected gas value - await driver.clickElement( - '[data-testid="transaction-list-item-primary-currency"]', + await driver.findElement( + '.transaction-list__completed-transactions .activity-list-item', ); - await driver.waitForSelector({ - xpath: "//div[contains(text(), 'Base fee')]", - }); - - const allFeeValues = await driver.findElements( - '.currency-display-component__text', + // The previous findElement already serves as the guard here for the assertElementNotPresent + await driver.assertElementNotPresent( + '.transaction-status-label--failed', ); - - /** - * Below lines check that fee values are numeric. - * Because these values change for every e2e run, - * It's better to just check that the values are there and are numeric - */ - assert.equal(allFeeValues.length > 0, true); - - allFeeValues.forEach(async (feeValue) => { - assert.equal(/\d+\.?\d*/u.test(await feeValue.getText()), true); - }); }, ); }); - }); - describe('to non-contract address with data that matches ERC20 transfer data signature', function () { - it('renders the correct recipient on the confirmation screen', async function () { + it('shows no error when cancel transaction when sending via QR code', async function () { await withFixtures( { - fixtures: new FixtureBuilder() - .withPreferencesController({ - featureFlags: { - sendHexData: true, - }, - }) - .withPreferencesControllerPetnamesDisabled() - .build(), + fixtures: new FixtureBuilder().build(), ganacheOptions: defaultGanacheOptions, title: this.test.fullTitle(), }, async ({ driver }) => { await unlockWallet(driver); - await tempToggleSettingRedesignedTransactionConfirmations(driver); - await driver.assertElementNotPresent('.loading-overlay__spinner'); const balance = await driver.findElement( '[data-testid="eth-overview__primary-currency"]', @@ -451,37 +533,254 @@ describe('Send ETH', function () { assert.ok(/^[\d.]+\sETH$/u.test(await balance.getText())); await openActionMenuAndStartSendFlow(driver); - - await driver.fill( - 'input[placeholder="Enter public address (0x) or domain name"]', - '0xc427D562164062a23a5cFf596A4a3208e72Acd28', + // choose to scan via QR code + await driver.clickElement('[data-testid="ens-qr-scan-button"]'); + await driver.findVisibleElement('[data-testid="qr-scanner-modal"]'); + // cancel action will close the dialog and shut down camera initialization + await driver.waitForSelector({ + css: '.qr-scanner__error', + text: "We couldn't access your camera. Please give it another try.", + }); + await driver.clickElement({ text: 'Cancel', tag: 'button' }); + await driver.assertElementNotPresent( + '[data-testid="qr-scanner-modal"]', ); + }, + ); + }); - await driver.fill( - 'textarea[placeholder="Optional', - '0xa9059cbb0000000000000000000000002f318C334780961FB129D2a6c30D0763d9a5C970000000000000000000000000000000000000000000000000000000000000000a', - ); + describe('from dapp using advanced gas controls', function () { + it('should display the correct gas price on the legacy transaction', async function () { + await withFixtures( + { + dapp: true, + fixtures: new FixtureBuilder() + .withPermissionControllerConnectedToTestDapp() + .build(), + ganacheOptions: defaultGanacheOptions, + defaultGanacheOptions, + title: this.test.fullTitle(), + }, + async ({ driver }) => { + await unlockWallet(driver); + + // initiates a send from the dapp + await openDapp(driver); + await driver.clickElement({ text: 'Send', tag: 'button' }); + const windowHandles = await driver.waitUntilXWindowHandles(3); + const extension = windowHandles[0]; + await driver.switchToWindowWithTitle( + WINDOW_TITLES.Dialog, + windowHandles, + ); + + await driver.clickElement('[data-testid="edit-gas-fee-icon"]'); + await driver.waitForSelector({ + text: '0.00021 ETH', + }); + await driver.clickElement({ + text: 'Edit suggested gas fee', + tag: 'button', + }); + await driver.waitForSelector({ + text: 'Edit priority', + tag: 'header', + }); + await editGasFeeForm(driver, '21000', '100'); + await driver.findElement({ + css: '[data-testid="first-gas-field"]', + text: '0.0021 ETH', + }); + + await driver.findElement({ + css: '[data-testid="native-currency"]', + text: '$3.57', + }); + + await driver.clickElement({ text: 'Confirm', tag: 'button' }); + await driver.waitUntilXWindowHandles(2); + await driver.switchToWindow(extension); + + // finds the transaction in the transactions list + await driver.clickElement( + '[data-testid="account-overview__activity-tab"]', + ); + await driver.waitForSelector( + '.transaction-list__completed-transactions .activity-list-item:nth-of-type(1)', + ); + await driver.waitForSelector({ + css: '[data-testid="transaction-list-item-primary-currency"]', + text: '-0 ETH', + }); + + // the transaction has the expected gas price + await driver.clickElement( + '[data-testid="transaction-list-item-primary-currency"]', + ); + await driver.waitForSelector({ + css: '[data-testid="transaction-breakdown__gas-price"]', + text: '100', + }); + }, + ); + }); + + it('should display correct gas values for EIP-1559 transaction', async function () { + await withFixtures( + { + dapp: true, + fixtures: new FixtureBuilder() + .withPermissionControllerConnectedToTestDapp() + .build(), + ganacheOptions: { + ...defaultGanacheOptions, + hardfork: 'london', + }, + title: this.test.fullTitle(), + }, + async ({ driver }) => { + await unlockWallet(driver); + + // initiates a transaction from the dapp + await openDapp(driver); + await driver.clickElement({ + text: 'Create Token', + tag: 'button', + }); + const windowHandles = await driver.waitUntilXWindowHandles(3); + + const extension = windowHandles[0]; + await driver.switchToWindowWithTitle( + WINDOW_TITLES.Dialog, + windowHandles, + ); + + await driver.clickElement('[data-testid="edit-gas-fee-icon"]'); + await driver.clickElement( + '[data-testid="edit-gas-fee-item-custom"]', + ); + + const baseFeeInput = await driver.findElement( + '[data-testid="base-fee-input"]', + ); + await baseFeeInput.fill('25'); + const priorityFeeInput = await driver.findElement( + '[data-testid="priority-fee-input"]', + ); + await priorityFeeInput.fill('1'); + + await driver.clickElement({ text: 'Save', tag: 'button' }); + + await driver.findElement({ + css: '[data-testid="first-gas-field"]', + text: '0.045 ETH', + }); + + await driver.findElement({ + css: '[data-testid="native-currency"]', + text: '$76.57', + }); + + await driver.clickElement({ text: 'Confirm', tag: 'button' }); + await driver.waitUntilXWindowHandles(2); + await driver.switchToWindow(extension); + + // Identify the transaction in the transactions list + await driver.waitForSelector( + '[data-testid="eth-overview__primary-currency"]', + ); + + await driver.clickElement( + '[data-testid="account-overview__activity-tab"]', + ); + await driver.waitForSelector( + '.transaction-list__completed-transactions .activity-list-item:nth-of-type(1)', + ); + await driver.waitForSelector({ + css: '[data-testid="transaction-list-item-primary-currency"]', + text: '-0 ETH', + }); + + // the transaction has the expected gas value + await driver.clickElement( + '[data-testid="transaction-list-item-primary-currency"]', + ); + + await driver.waitForSelector({ + xpath: "//div[contains(text(), 'Base fee')]", + }); + + const allFeeValues = await driver.findElements( + '.currency-display-component__text', + ); + + /** + * Below lines check that fee values are numeric. + * Because these values change for every e2e run, + * It's better to just check that the values are there and are numeric + */ + assert.equal(allFeeValues.length > 0, true); + + allFeeValues.forEach(async (feeValue) => { + assert.equal(/\d+\.?\d*/u.test(await feeValue.getText()), true); + }); + }, + ); + }); + }); - await driver.findClickableElement({ - text: 'Continue', - tag: 'button', - }); - await driver.clickElement({ text: 'Continue', tag: 'button' }); + describe('to non-contract address with data that matches ERC20 transfer data signature', function () { + it('renders the correct recipient on the confirmation screen', async function () { + await withFixtures( + { + fixtures: new FixtureBuilder() + .withPreferencesController({ + featureFlags: { + sendHexData: true, + }, + }) + .withPreferencesControllerPetnamesDisabled() + .build(), + ganacheOptions: defaultGanacheOptions, + title: this.test.fullTitle(), + }, + async ({ driver }) => { + await unlockWallet(driver); - await driver.findClickableElement( - '[data-testid="sender-to-recipient__name"]', - ); - await driver.clickElement( - '[data-testid="sender-to-recipient__name"]', - ); + await driver.assertElementNotPresent('.loading-overlay__spinner'); + const balance = await driver.findElement( + '[data-testid="eth-overview__primary-currency"]', + ); + assert.ok(/^[\d.]+\sETH$/u.test(await balance.getText())); - const recipientAddress = await driver.findElements({ - text: '0xc427D562164062a23a5cFf596A4a3208e72Acd28', - }); + await openActionMenuAndStartSendFlow(driver); - assert.equal(recipientAddress.length, 1); - }, - ); + await driver.fill( + 'input[placeholder="Enter public address (0x) or domain name"]', + '0xc427D562164062a23a5cFf596A4a3208e72Acd28', + ); + + await driver.fill( + 'textarea[placeholder="Optional', + '0xa9059cbb0000000000000000000000002f318C334780961FB129D2a6c30D0763d9a5C970000000000000000000000000000000000000000000000000000000000000000a', + ); + + await driver.findClickableElement({ + text: 'Continue', + tag: 'button', + }); + await driver.clickElement({ text: 'Continue', tag: 'button' }); + + await driver.clickElement('[data-testid="recipient-address"]'); + + const recipientAddress = await driver.findElements({ + text: '0xc427D562164062a23a5cFf596A4a3208e72Acd28', + }); + + assert.equal(recipientAddress.length, 1); + }, + ); + }); }); }); }); diff --git a/test/e2e/tests/transaction/send-hex-address.spec.js b/test/e2e/tests/transaction/send-hex-address.spec.js index b6ad969c6735..64522c706f6b 100644 --- a/test/e2e/tests/transaction/send-hex-address.spec.js +++ b/test/e2e/tests/transaction/send-hex-address.spec.js @@ -11,228 +11,377 @@ const FixtureBuilder = require('../../fixture-builder'); const hexPrefixedAddress = '0x2f318C334780961FB129D2a6c30D0763d9a5C970'; const nonHexPrefixedAddress = hexPrefixedAddress.substring(2); -describe('Send ETH to a 40 character hexadecimal address', function () { - it('should ensure the address is prefixed with 0x when pasted and should send ETH to a valid hexadecimal address', async function () { - await withFixtures( - { - fixtures: new FixtureBuilder() - .withPreferencesControllerPetnamesDisabled() - .build(), - ganacheOptions: defaultGanacheOptions, - title: this.test.fullTitle(), - }, - async ({ driver, ganacheServer }) => { - await logInWithBalanceValidation(driver, ganacheServer); - - // Send ETH - await openActionMenuAndStartSendFlow(driver); - // Paste address without hex prefix - await driver.pasteIntoField( - 'input[placeholder="Enter public address (0x) or domain name"]', - nonHexPrefixedAddress, - ); - await driver.findElement({ - css: '.ens-input__selected-input__title', - text: '0x2f318...5C970', - }); - await driver.clickElement({ text: 'Continue', tag: 'button' }); - - // Confirm transaction - await driver.clickElement({ text: 'Confirm', tag: 'button' }); - await driver.clickElement( - '[data-testid="account-overview__activity-tab"]', - ); - const sendTransactionListItem = await driver.findElement( - '.transaction-list__completed-transactions .activity-list-item', - ); - await sendTransactionListItem.click(); - await driver.clickElement({ text: 'Activity log', tag: 'summary' }); - await driver.clickElement('[data-testid="sender-to-recipient__name"]'); - - // Verify address in activity log - await driver.findElement({ - css: '.nickname-popover__public-address', - text: hexPrefixedAddress, - }); - }, - ); - }); - it('should ensure the address is prefixed with 0x when typed and should send ETH to a valid hexadecimal address', async function () { - await withFixtures( - { - fixtures: new FixtureBuilder() - .withPreferencesControllerPetnamesDisabled() - .build(), - ganacheOptions: defaultGanacheOptions, - title: this.test.fullTitle(), - }, - async ({ driver, ganacheServer }) => { - await logInWithBalanceValidation(driver, ganacheServer); - - // Send ETH - await openActionMenuAndStartSendFlow(driver); - // Type address without hex prefix - await driver.fill( - 'input[placeholder="Enter public address (0x) or domain name"]', - nonHexPrefixedAddress, - ); - await driver.findElement({ - css: '.ens-input__selected-input__title', - text: '0x2f318...5C970', - }); - await driver.clickElement({ text: 'Continue', tag: 'button' }); - - // Confirm transaction - await driver.clickElement({ text: 'Confirm', tag: 'button' }); - await driver.clickElement( - '[data-testid="account-overview__activity-tab"]', - ); - await driver.clickElement( - '.transaction-list__completed-transactions .activity-list-item', - ); - await driver.clickElement({ text: 'Activity log', tag: 'summary' }); - await driver.clickElement('[data-testid="sender-to-recipient__name"]'); - - // Verify address in activity log - await driver.findElement({ - css: '.nickname-popover__public-address', - text: hexPrefixedAddress, - }); - }, - ); +describe('Old confirmation screens', function () { + describe('Send ERC20 to a 40 character hexadecimal address', function () { + const smartContract = SMART_CONTRACTS.HST; + + it('should ensure the address is prefixed with 0x when pasted and should send TST to a valid hexadecimal address', async function () { + await withFixtures( + { + dapp: true, + fixtures: new FixtureBuilder() + .withPreferencesControllerPetnamesDisabled() + .withTokensControllerERC20() + .build(), + ganacheOptions: defaultGanacheOptions, + smartContract, + title: this.test.fullTitle(), + }, + async ({ driver, ganacheServer }) => { + await logInWithBalanceValidation(driver, ganacheServer); + + await tempToggleSettingRedesignedTransactionConfirmations(driver); + + // Send TST + await driver.clickElement( + '[data-testid="account-overview__asset-tab"]', + ); + await driver.clickElement( + '[data-testid="multichain-token-list-button"]', + ); + await driver.clickElement('[data-testid="coin-overview-send"]'); + // Paste address without hex prefix + await driver.pasteIntoField( + 'input[placeholder="Enter public address (0x) or domain name"]', + nonHexPrefixedAddress, + ); + await driver.findElement({ + css: '.ens-input__selected-input__title', + text: '0x2f318...5C970', + }); + + await driver.clickElement({ text: 'Continue', tag: 'button' }); + + // Confirm transaction + await driver.findElement({ + css: '.confirm-page-container-summary__title', + text: '0', + }); + await driver.clickElement({ text: 'Confirm', tag: 'button' }); + await driver.clickElement( + '[data-testid="account-overview__activity-tab"]', + ); + await driver.findElement( + '.transaction-list__completed-transactions .activity-list-item:nth-of-type(1)', + ); + const sendTransactionListItem = await driver.findElement( + '.transaction-list__completed-transactions .activity-list-item:nth-of-type(1)', + ); + await sendTransactionListItem.click(); + await driver.clickElement({ text: 'Activity log', tag: 'summary' }); + await driver.clickElement( + '[data-testid="sender-to-recipient__name"]', + ); + + // Verify address in activity log + await driver.findElement({ + css: '.nickname-popover__public-address', + text: hexPrefixedAddress, + }); + }, + ); + }); + + it('should ensure the address is prefixed with 0x when typed and should send TST to a valid hexadecimal address', async function () { + await withFixtures( + { + dapp: true, + fixtures: new FixtureBuilder() + .withPreferencesControllerPetnamesDisabled() + .withTokensControllerERC20() + .build(), + ganacheOptions: defaultGanacheOptions, + smartContract, + title: this.test.fullTitle(), + }, + async ({ driver, ganacheServer }) => { + await logInWithBalanceValidation(driver, ganacheServer); + + await tempToggleSettingRedesignedTransactionConfirmations(driver); + + // Send TST + await driver.clickElement( + '[data-testid="account-overview__asset-tab"]', + ); + await driver.clickElement( + '[data-testid="multichain-token-list-button"]', + ); + await driver.clickElement('[data-testid="coin-overview-send"]'); + + // Type address without hex prefix + await driver.fill( + 'input[placeholder="Enter public address (0x) or domain name"]', + nonHexPrefixedAddress, + ); + await driver.findElement({ + css: '.ens-input__selected-input__title', + text: '0x2f318...5C970', + }); + + await driver.clickElement({ text: 'Continue', tag: 'button' }); + + // Confirm transaction + await driver.findElement({ + css: '.confirm-page-container-summary__title', + text: '0', + }); + await driver.clickElement({ text: 'Confirm', tag: 'button' }); + await driver.clickElement( + '[data-testid="account-overview__activity-tab"]', + ); + await driver.findElement( + '.transaction-list__completed-transactions .activity-list-item:nth-of-type(1)', + ); + const sendTransactionListItem = await driver.findElement( + '.transaction-list__completed-transactions .activity-list-item:nth-of-type(1)', + ); + await sendTransactionListItem.click(); + await driver.clickElement({ text: 'Activity log', tag: 'summary' }); + await driver.clickElement( + '[data-testid="sender-to-recipient__name"]', + ); + + // Verify address in activity log + await driver.findElement({ + css: '.nickname-popover__public-address', + text: hexPrefixedAddress, + }); + }, + ); + }); }); }); -describe('Send ERC20 to a 40 character hexadecimal address', function () { - const smartContract = SMART_CONTRACTS.HST; - - it('should ensure the address is prefixed with 0x when pasted and should send TST to a valid hexadecimal address', async function () { - await withFixtures( - { - dapp: true, - fixtures: new FixtureBuilder() - .withPreferencesControllerPetnamesDisabled() - .withTokensControllerERC20() - .build(), - ganacheOptions: defaultGanacheOptions, - smartContract, - title: this.test.fullTitle(), - }, - async ({ driver, ganacheServer }) => { - await logInWithBalanceValidation(driver, ganacheServer); - - await tempToggleSettingRedesignedTransactionConfirmations(driver); - - // Send TST - await driver.clickElement( - '[data-testid="account-overview__asset-tab"]', - ); - await driver.clickElement( - '[data-testid="multichain-token-list-button"]', - ); - await driver.clickElement('[data-testid="coin-overview-send"]'); - // Paste address without hex prefix - await driver.pasteIntoField( - 'input[placeholder="Enter public address (0x) or domain name"]', - nonHexPrefixedAddress, - ); - await driver.findElement({ - css: '.ens-input__selected-input__title', - text: '0x2f318...5C970', - }); - - await driver.clickElement({ text: 'Continue', tag: 'button' }); - - // Confirm transaction - await driver.findElement({ - css: '.confirm-page-container-summary__title', - text: '0', - }); - await driver.clickElement({ text: 'Confirm', tag: 'button' }); - await driver.clickElement( - '[data-testid="account-overview__activity-tab"]', - ); - await driver.findElement( - '.transaction-list__completed-transactions .activity-list-item:nth-of-type(1)', - ); - const sendTransactionListItem = await driver.findElement( - '.transaction-list__completed-transactions .activity-list-item:nth-of-type(1)', - ); - await sendTransactionListItem.click(); - await driver.clickElement({ text: 'Activity log', tag: 'summary' }); - await driver.clickElement('[data-testid="sender-to-recipient__name"]'); - - // Verify address in activity log - await driver.findElement({ - css: '.nickname-popover__public-address', - text: hexPrefixedAddress, - }); - }, - ); +describe('Redesigned confirmation screens', function () { + describe('Send ETH to a 40 character hexadecimal address', function () { + it('should ensure the address is prefixed with 0x when pasted and should send ETH to a valid hexadecimal address', async function () { + await withFixtures( + { + fixtures: new FixtureBuilder() + .withPreferencesControllerPetnamesDisabled() + .build(), + ganacheOptions: defaultGanacheOptions, + title: this.test.fullTitle(), + }, + async ({ driver, ganacheServer }) => { + await logInWithBalanceValidation(driver, ganacheServer); + + // Send ETH + await openActionMenuAndStartSendFlow(driver); + // Paste address without hex prefix + await driver.pasteIntoField( + 'input[placeholder="Enter public address (0x) or domain name"]', + nonHexPrefixedAddress, + ); + await driver.findElement({ + css: '.ens-input__selected-input__title', + text: '0x2f318...5C970', + }); + await driver.clickElement({ text: 'Continue', tag: 'button' }); + + // Confirm transaction + await driver.clickElement({ text: 'Confirm', tag: 'button' }); + await driver.clickElement( + '[data-testid="account-overview__activity-tab"]', + ); + const sendTransactionListItem = await driver.findElement( + '.transaction-list__completed-transactions .activity-list-item', + ); + await sendTransactionListItem.click(); + await driver.clickElement({ text: 'Activity log', tag: 'summary' }); + await driver.clickElement( + '[data-testid="sender-to-recipient__name"]', + ); + + // Verify address in activity log + await driver.findElement({ + css: '.nickname-popover__public-address', + text: hexPrefixedAddress, + }); + }, + ); + }); + + it('should ensure the address is prefixed with 0x when typed and should send ETH to a valid hexadecimal address', async function () { + await withFixtures( + { + fixtures: new FixtureBuilder() + .withPreferencesControllerPetnamesDisabled() + .build(), + ganacheOptions: defaultGanacheOptions, + title: this.test.fullTitle(), + }, + async ({ driver, ganacheServer }) => { + await logInWithBalanceValidation(driver, ganacheServer); + + // Send ETH + await openActionMenuAndStartSendFlow(driver); + // Type address without hex prefix + await driver.fill( + 'input[placeholder="Enter public address (0x) or domain name"]', + nonHexPrefixedAddress, + ); + await driver.findElement({ + css: '.ens-input__selected-input__title', + text: '0x2f318...5C970', + }); + await driver.clickElement({ text: 'Continue', tag: 'button' }); + + // Confirm transaction + await driver.clickElement({ text: 'Confirm', tag: 'button' }); + await driver.clickElement( + '[data-testid="account-overview__activity-tab"]', + ); + await driver.clickElement( + '.transaction-list__completed-transactions .activity-list-item', + ); + await driver.clickElement({ text: 'Activity log', tag: 'summary' }); + await driver.clickElement( + '[data-testid="sender-to-recipient__name"]', + ); + + // Verify address in activity log + await driver.findElement({ + css: '.nickname-popover__public-address', + text: hexPrefixedAddress, + }); + }, + ); + }); }); - it('should ensure the address is prefixed with 0x when typed and should send TST to a valid hexadecimal address', async function () { - await withFixtures( - { - dapp: true, - fixtures: new FixtureBuilder() - .withPreferencesControllerPetnamesDisabled() - .withTokensControllerERC20() - .build(), - ganacheOptions: defaultGanacheOptions, - smartContract, - title: this.test.fullTitle(), - }, - async ({ driver, ganacheServer }) => { - await logInWithBalanceValidation(driver, ganacheServer); - - await tempToggleSettingRedesignedTransactionConfirmations(driver); - - // Send TST - await driver.clickElement( - '[data-testid="account-overview__asset-tab"]', - ); - await driver.clickElement( - '[data-testid="multichain-token-list-button"]', - ); - await driver.clickElement('[data-testid="coin-overview-send"]'); - - // Type address without hex prefix - await driver.fill( - 'input[placeholder="Enter public address (0x) or domain name"]', - nonHexPrefixedAddress, - ); - await driver.findElement({ - css: '.ens-input__selected-input__title', - text: '0x2f318...5C970', - }); - - await driver.clickElement({ text: 'Continue', tag: 'button' }); - - // Confirm transaction - await driver.findElement({ - css: '.confirm-page-container-summary__title', - text: '0', - }); - await driver.clickElement({ text: 'Confirm', tag: 'button' }); - await driver.clickElement( - '[data-testid="account-overview__activity-tab"]', - ); - await driver.findElement( - '.transaction-list__completed-transactions .activity-list-item:nth-of-type(1)', - ); - const sendTransactionListItem = await driver.findElement( - '.transaction-list__completed-transactions .activity-list-item:nth-of-type(1)', - ); - await sendTransactionListItem.click(); - await driver.clickElement({ text: 'Activity log', tag: 'summary' }); - await driver.clickElement('[data-testid="sender-to-recipient__name"]'); - - // Verify address in activity log - await driver.findElement({ - css: '.nickname-popover__public-address', - text: hexPrefixedAddress, - }); - }, - ); + + describe('Send ERC20 to a 40 character hexadecimal address', function () { + const smartContract = SMART_CONTRACTS.HST; + + it('should ensure the address is prefixed with 0x when pasted and should send TST to a valid hexadecimal address', async function () { + await withFixtures( + { + dapp: true, + fixtures: new FixtureBuilder() + .withPreferencesControllerPetnamesDisabled() + .withTokensControllerERC20() + .build(), + ganacheOptions: defaultGanacheOptions, + smartContract, + title: this.test.fullTitle(), + }, + async ({ driver, ganacheServer }) => { + await logInWithBalanceValidation(driver, ganacheServer); + + // Send TST + await driver.clickElement( + '[data-testid="account-overview__asset-tab"]', + ); + await driver.clickElement( + '[data-testid="multichain-token-list-button"]', + ); + await driver.clickElement('[data-testid="coin-overview-send"]'); + // Paste address without hex prefix + await driver.pasteIntoField( + 'input[placeholder="Enter public address (0x) or domain name"]', + nonHexPrefixedAddress, + ); + await driver.findElement({ + css: '.ens-input__selected-input__title', + text: '0x2f318...5C970', + }); + + await driver.clickElement({ text: 'Continue', tag: 'button' }); + + // Confirm transaction + await driver.findElement({ + css: 'h2', + text: '0 ETH', + }); + await driver.clickElement({ text: 'Confirm', tag: 'button' }); + await driver.clickElement( + '[data-testid="account-overview__activity-tab"]', + ); + await driver.findElement( + '.transaction-list__completed-transactions .activity-list-item:nth-of-type(1)', + ); + const sendTransactionListItem = await driver.findElement( + '.transaction-list__completed-transactions .activity-list-item:nth-of-type(1)', + ); + await sendTransactionListItem.click(); + await driver.clickElement({ text: 'Activity log', tag: 'summary' }); + await driver.clickElement( + '[data-testid="sender-to-recipient__name"]', + ); + + // Verify address in activity log + await driver.findElement({ + css: '.nickname-popover__public-address', + text: hexPrefixedAddress, + }); + }, + ); + }); + + it('should ensure the address is prefixed with 0x when typed and should send TST to a valid hexadecimal address', async function () { + await withFixtures( + { + dapp: true, + fixtures: new FixtureBuilder() + .withPreferencesControllerPetnamesDisabled() + .withTokensControllerERC20() + .build(), + ganacheOptions: defaultGanacheOptions, + smartContract, + title: this.test.fullTitle(), + }, + async ({ driver, ganacheServer }) => { + await logInWithBalanceValidation(driver, ganacheServer); + + // Send TST + await driver.clickElement( + '[data-testid="account-overview__asset-tab"]', + ); + await driver.clickElement( + '[data-testid="multichain-token-list-button"]', + ); + await driver.clickElement('[data-testid="coin-overview-send"]'); + + // Type address without hex prefix + await driver.fill( + 'input[placeholder="Enter public address (0x) or domain name"]', + nonHexPrefixedAddress, + ); + await driver.findElement({ + css: '.ens-input__selected-input__title', + text: '0x2f318...5C970', + }); + + await driver.clickElement({ text: 'Continue', tag: 'button' }); + + // Confirm transaction + await driver.findElement({ + css: 'h2', + text: '0 ETH', + }); + await driver.clickElement({ text: 'Confirm', tag: 'button' }); + await driver.clickElement( + '[data-testid="account-overview__activity-tab"]', + ); + await driver.findElement( + '.transaction-list__completed-transactions .activity-list-item:nth-of-type(1)', + ); + const sendTransactionListItem = await driver.findElement( + '.transaction-list__completed-transactions .activity-list-item:nth-of-type(1)', + ); + await sendTransactionListItem.click(); + await driver.clickElement({ text: 'Activity log', tag: 'summary' }); + await driver.clickElement( + '[data-testid="sender-to-recipient__name"]', + ); + + // Verify address in activity log + await driver.findElement({ + css: '.nickname-popover__public-address', + text: hexPrefixedAddress, + }); + }, + ); + }); }); }); diff --git a/ui/pages/confirmations/components/confirm/info/token-transfer/__snapshots__/transaction-flow-section.test.tsx.snap b/ui/pages/confirmations/components/confirm/info/token-transfer/__snapshots__/transaction-flow-section.test.tsx.snap index b42f23b15d4b..89750227da0f 100644 --- a/ui/pages/confirmations/components/confirm/info/token-transfer/__snapshots__/transaction-flow-section.test.tsx.snap +++ b/ui/pages/confirmations/components/confirm/info/token-transfer/__snapshots__/transaction-flow-section.test.tsx.snap @@ -28,6 +28,7 @@ exports[` renders correctly 1`] = `
renders correctly 1`] = `
{ flexDirection: FlexDirection.Column, }} > - + { flexDirection: FlexDirection.Column, }} > - +

1 of