From d45cb6c12e6da52180fd5f60f67e2fdde4d78e0a Mon Sep 17 00:00:00 2001 From: Brad Decker Date: Wed, 9 Feb 2022 07:57:05 -0600 Subject: [PATCH] update test-dapp to 5.0.0 (#13503) * update test-dapp to 5.0.0 * Update edit-gas-fee.spec.js * Lint * Update send-eth.spec.js * Update signature-request.spec.js * typo Co-authored-by: PeterYinusa Co-authored-by: Alex Donesky --- package.json | 2 +- test/e2e/tests/edit-gas-fee.spec.js | 13 ++++++++----- test/e2e/tests/send-eth.spec.js | 2 +- test/e2e/tests/signature-request.spec.js | 4 ++-- yarn.lock | 8 ++++---- 5 files changed, 16 insertions(+), 13 deletions(-) diff --git a/package.json b/package.json index 0cc27667f..37c1fbe4b 100644 --- a/package.json +++ b/package.json @@ -239,7 +239,7 @@ "@metamask/eslint-config-mocha": "^9.0.0", "@metamask/eslint-config-nodejs": "^9.0.0", "@metamask/forwarder": "^1.1.0", - "@metamask/test-dapp": "^4.0.1", + "@metamask/test-dapp": "^5.0.0", "@sentry/cli": "^1.58.0", "@storybook/addon-a11y": "^6.3.12", "@storybook/addon-actions": "^6.3.12", diff --git a/test/e2e/tests/edit-gas-fee.spec.js b/test/e2e/tests/edit-gas-fee.spec.js index a00b18a0c..f6898344b 100644 --- a/test/e2e/tests/edit-gas-fee.spec.js +++ b/test/e2e/tests/edit-gas-fee.spec.js @@ -216,7 +216,10 @@ describe('Editing Confirm Transaction', function () { // open dapp and connect await connectDappWithExtensionPopup(driver); - await driver.clickElement({ text: 'Send', tag: 'button' }); + await driver.clickElement({ + text: 'Send EIP 1559 Transaction', + tag: 'button', + }); // check transaction in extension popup const windowHandles = await getWindowHandles(driver, 3); @@ -238,17 +241,17 @@ describe('Editing Confirm Transaction', function () { '.currency-display-component__text', ); const transactionAmount = transactionAmounts[0]; - assert.equal(await transactionAmount.getText(), '3'); + assert.equal(await transactionAmount.getText(), '0'); // has correct updated value on the confirm screen the transaction const editedTransactionAmounts = await driver.findElements( '.transaction-detail-item__row .transaction-detail-item__detail-values .currency-display-component__text:last-of-type', ); const editedTransactionAmount = editedTransactionAmounts[0]; - assert.equal(await editedTransactionAmount.getText(), '0.00042'); + assert.equal(await editedTransactionAmount.getText(), '0.00021'); const editedTransactionFee = editedTransactionAmounts[1]; - assert.equal(await editedTransactionFee.getText(), '3.00042'); + assert.equal(await editedTransactionFee.getText(), '0.00021'); // confirms the transaction await driver.clickElement({ text: 'Confirm', tag: 'button' }); @@ -268,7 +271,7 @@ describe('Editing Confirm Transaction', function () { '.transaction-list-item__primary-currency', ); assert.equal(txValues.length, 1); - assert.ok(/-3\s*ETH/u.test(await txValues[0].getText())); + assert.ok(/-0\s*ETH/u.test(await txValues[0].getText())); }, ); }); diff --git a/test/e2e/tests/send-eth.spec.js b/test/e2e/tests/send-eth.spec.js index 0ae41b809..c0968466c 100644 --- a/test/e2e/tests/send-eth.spec.js +++ b/test/e2e/tests/send-eth.spec.js @@ -256,7 +256,7 @@ describe('Send ETH from dapp using advanced gas controls', function () { ); await driver.waitForSelector({ css: '.transaction-list-item__primary-currency', - text: '-3 ETH', + text: '-0 ETH', }); // the transaction has the expected gas price diff --git a/test/e2e/tests/signature-request.spec.js b/test/e2e/tests/signature-request.spec.js index 35184e9d6..99579fec9 100644 --- a/test/e2e/tests/signature-request.spec.js +++ b/test/e2e/tests/signature-request.spec.js @@ -126,7 +126,7 @@ describe('Sign Typed Data V3 Signature Request', function () { ); const origin = content[0]; const address = content[1]; - const message = await driver.findElement( + const messages = await driver.findElements( '.signature-request-message--node-value', ); assert.equal(await title.getText(), 'Signature Request'); @@ -138,7 +138,7 @@ describe('Sign Typed Data V3 Signature Request', function () { publicAddress.length - 8, )}`, ); - assert.equal(await message.getText(), 'Hello, Bob!'); + assert.equal(await messages[4].getText(), 'Hello, Bob!'); // Approve signing typed data await driver.clickElement({ text: 'Sign', tag: 'button' }); diff --git a/yarn.lock b/yarn.lock index 39a9b6dc0..f01a36c88 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2873,10 +2873,10 @@ resolved "https://registry.yarnpkg.com/@metamask/snap-workers/-/snap-workers-0.5.0.tgz#9f1b8243f64819e40d66e659d580b6da59cb8015" integrity sha512-sR30/nmkndPeLox282BdTNnU3g6Mo5Gt8rdr6PUSyfosbwrYtrbZcXFqR+ozK/gNhJ3de7hpjLXKNkVSF8OjOQ== -"@metamask/test-dapp@^4.0.1": - version "4.0.1" - resolved "https://registry.yarnpkg.com/@metamask/test-dapp/-/test-dapp-4.0.1.tgz#fbc66069687f0502ebb4c6ac0fa7c9862ea6563c" - integrity sha512-FN2Rz7ctY7Blx3iK6AmZmZEU+TkvEcpYvvebUmqZyOrmjh/DsYKVxfRicVAbyK9mDkeJ18Gx8r7swwFFR4rSgA== +"@metamask/test-dapp@^5.0.0": + version "5.0.0" + resolved "https://registry.yarnpkg.com/@metamask/test-dapp/-/test-dapp-5.0.0.tgz#ecea832b57ff97782bfdd57a4af3408c7c64c02d" + integrity sha512-eR9JQ0jPOeP/hdQj9hUkqbvinfjVLYTtdHV+mDCN1tsNxiTdninZbltg9bx6Gqp91v9/9YPhlhXCmMQPq/AMxQ== "@mrmlnc/readdir-enhanced@^2.2.1": version "2.2.1"