From 80e4a1fef4b8e7561bf222e4f5ab4e9de3e235cc Mon Sep 17 00:00:00 2001 From: amerkadicE <97883527+amerkadicE@users.noreply.github.com> Date: Wed, 30 Nov 2022 19:11:36 +0100 Subject: [PATCH] Update signature request screens (#15776) Fix e2e test Update siteicon for v4 signature type Code refactor Code refactor Remove origin and address in signatrue request Update e2e tests Use getNetworkName function Move header component inline jsx Update snaps --- test/e2e/tests/eth-sign.spec.js | 2 +- test/e2e/tests/signature-request.spec.js | 27 +-- .../signature-request-original.test.js.snap | 220 +++++++++--------- .../app/signature-request-original/index.scss | 118 +--------- .../signature-request-original.component.js | 188 ++++++--------- .../signature-request-original.container.js | 3 +- .../app/signature-request/index.scss | 28 --- .../signature-request.component.js | 106 +++++++-- .../signature-request.component.test.js | 2 + .../signature-request.container.js | 20 +- .../signature-request.container.test.js | 3 + 11 files changed, 304 insertions(+), 413 deletions(-) diff --git a/test/e2e/tests/eth-sign.spec.js b/test/e2e/tests/eth-sign.spec.js index 58c3e6114..528a55be8 100644 --- a/test/e2e/tests/eth-sign.spec.js +++ b/test/e2e/tests/eth-sign.spec.js @@ -42,7 +42,7 @@ describe('Eth sign', function () { ); const title = await driver.findElement( - '.request-signature__header__text', + '.request-signature__content__title', ); const origin = await driver.findElement('.request-signature__origin'); assert.equal(await title.getText(), 'Signature request'); diff --git a/test/e2e/tests/signature-request.spec.js b/test/e2e/tests/signature-request.spec.js index bbf2f742f..91a91eaf0 100644 --- a/test/e2e/tests/signature-request.spec.js +++ b/test/e2e/tests/signature-request.spec.js @@ -45,23 +45,17 @@ describe('Sign Typed Data V4 Signature Request', function () { ); const title = await driver.findElement( - '.signature-request-content__title', - ); - const name = await driver.findElement( - '.signature-request-content__info--bolded', - ); - const content = await driver.findElements( - '.signature-request-content__info', + '.signature-request__content__title', ); + const origin = await driver.findElement('.signature-request__origin'); const verifyContractDetailsButton = await driver.findElement( '.signature-request-content__verify-contract-details', ); - const origin = content[0]; const message = await driver.findElement( '.signature-request-data__node__value', ); + assert.equal(await title.getText(), 'Signature request'); - assert.equal(await name.getText(), 'Ether Mail'); assert.equal(await origin.getText(), 'http://127.0.0.1:8080'); verifyContractDetailsButton.click(); @@ -131,23 +125,18 @@ describe('Sign Typed Data V3 Signature Request', function () { ); const title = await driver.findElement( - '.signature-request-content__title', - ); - const name = await driver.findElement( - '.signature-request-content__info--bolded', - ); - const content = await driver.findElements( - '.signature-request-content__info', + '.signature-request__content__title', ); + const origin = await driver.findElement('.signature-request__origin'); const verifyContractDetailsButton = await driver.findElement( '.signature-request-content__verify-contract-details', ); - const origin = content[0]; + const messages = await driver.findElements( '.signature-request-data__node__value', ); + assert.equal(await title.getText(), 'Signature request'); - assert.equal(await name.getText(), 'Ether Mail'); assert.equal(await origin.getText(), 'http://127.0.0.1:8080'); verifyContractDetailsButton.click(); @@ -217,7 +206,7 @@ describe('Sign Typed Data Signature Request', function () { ); const title = await driver.findElement( - '.request-signature__header__text', + '.request-signature__content__title', ); const origin = await driver.findElement('.request-signature__origin'); const message = await driver.findElements( diff --git a/ui/components/app/signature-request-original/__snapshots__/signature-request-original.test.js.snap b/ui/components/app/signature-request-original/__snapshots__/signature-request-original.test.js.snap index 227cf4d2e..6bf931eb6 100644 --- a/ui/components/app/signature-request-original/__snapshots__/signature-request-original.test.js.snap +++ b/ui/components/app/signature-request-original/__snapshots__/signature-request-original.test.js.snap @@ -6,142 +6,140 @@ exports[`SignatureRequestOriginal should match snapshot 1`] = ` class="request-signature__container" >
-
- Signature request -
-
+ class="box box--display-flex box--gap-2 box--flex-direction-row box--align-items-center" + > +
+
+
+
+ + + + + +
+
+
+ +
+
+
+ Unknown private network +
+
+ Test Account +
+
+
+
+
+ Balance +
+
+ 0 + + ETH +
+