From dd2f5284bcc5506d00ba9160d49a94c526443b4e Mon Sep 17 00:00:00 2001 From: Matthew Walsh Date: Wed, 19 Jun 2024 12:31:04 +0100 Subject: [PATCH] Fix unit tests --- .../info/__snapshots__/info.test.tsx.snap | 2 +- .../row/__snapshots__/divider.test.tsx.snap | 2 +- .../app/confirm/info/row/divider.tsx | 1 + .../info/__snapshots__/info.test.tsx.snap | 156 +++--- .../contract-interaction.test.tsx.snap | 2 +- .../transaction-details.test.tsx.snap | 188 +++---- .../__snapshots__/typed-sign.test.tsx.snap | 468 +++++++++--------- .../__snapshots__/confirm.test.tsx.snap | 182 +++---- 8 files changed, 473 insertions(+), 528 deletions(-) diff --git a/ui/components/app/confirm/info/__snapshots__/info.test.tsx.snap b/ui/components/app/confirm/info/__snapshots__/info.test.tsx.snap index 1054ecabe66a..a257e3ee3fa8 100644 --- a/ui/components/app/confirm/info/__snapshots__/info.test.tsx.snap +++ b/ui/components/app/confirm/info/__snapshots__/info.test.tsx.snap @@ -77,7 +77,7 @@ exports[`ConfirmInfo should match snapshot 1`] = `
`; diff --git a/ui/components/app/confirm/info/row/divider.tsx b/ui/components/app/confirm/info/row/divider.tsx index 94fc4bb7062e..98c09840f4bb 100644 --- a/ui/components/app/confirm/info/row/divider.tsx +++ b/ui/components/app/confirm/info/row/divider.tsx @@ -6,6 +6,7 @@ export const ConfirmInfoRowDivider: React.FC = () => { style={{ height: '1px', backgroundColor: 'var(--color-border-muted)', + // Ignore the padding from the section. marginLeft: '-8px', marginRight: '-8px', }} diff --git a/ui/pages/confirmations/components/confirm/info/__snapshots__/info.test.tsx.snap b/ui/pages/confirmations/components/confirm/info/__snapshots__/info.test.tsx.snap index 086498a0f4d8..d9f473782e78 100644 --- a/ui/pages/confirmations/components/confirm/info/__snapshots__/info.test.tsx.snap +++ b/ui/pages/confirmations/components/confirm/info/__snapshots__/info.test.tsx.snap @@ -78,122 +78,114 @@ exports[`Info renders info section for personal sign request 1`] = ` exports[`Info renders info section for typed sign request 1`] = `
-
-

+

+
- Request from -

-
-
- -
+
-
+
+

-

- metamask.github.io -

-
+ metamask.github.io +

-
-

- Interacting with -

-
+ Interacting with +

+
+
-

- 0xCcCCc...ccccC -

+

+ 0xCcCCc...ccccC +

diff --git a/ui/pages/confirmations/components/confirm/info/contract-interaction/__snapshots__/contract-interaction.test.tsx.snap b/ui/pages/confirmations/components/confirm/info/contract-interaction/__snapshots__/contract-interaction.test.tsx.snap index cf11076fc92e..2ba4eb76e72e 100644 --- a/ui/pages/confirmations/components/confirm/info/contract-interaction/__snapshots__/contract-interaction.test.tsx.snap +++ b/ui/pages/confirmations/components/confirm/info/contract-interaction/__snapshots__/contract-interaction.test.tsx.snap @@ -5,7 +5,7 @@ exports[` does not render if required data is not pre exports[` renders component for contract interaction request 1`] = `
does not render component for transaction details 1`] = `
`; +exports[` does not render component for transaction details 1`] = ` +
+
+
+`; exports[` renders component for transaction details 1`] = `
-

- Request from -

-
-
- + Request from +

+
+
+ +
-
-
-

- metamask.github.io -

+

+ metamask.github.io +

+
-
-
-

- Interacting with -

-
-
- + Interacting with +

+
+
+ +
-
-
+

+ 0x88AA6...A5125 +

-

- 0x88AA6...A5125 -

diff --git a/ui/pages/confirmations/components/confirm/info/typed-sign/__snapshots__/typed-sign.test.tsx.snap b/ui/pages/confirmations/components/confirm/info/typed-sign/__snapshots__/typed-sign.test.tsx.snap index 1d14c6815c89..cf3c57f86829 100644 --- a/ui/pages/confirmations/components/confirm/info/typed-sign/__snapshots__/typed-sign.test.tsx.snap +++ b/ui/pages/confirmations/components/confirm/info/typed-sign/__snapshots__/typed-sign.test.tsx.snap @@ -5,122 +5,114 @@ exports[`TypedSignInfo does not render if required data is not present in the tr exports[`TypedSignInfo renders origin for typed sign data request 1`] = `
-
-

+

+
- Request from -

-
-
- -
+
-
+
+

-

- metamask.github.io -

-
+ metamask.github.io +

-
-

- Interacting with -

-
+ Interacting with +

+
+
-

- 0xCcCCc...ccccC -

+

+ 0xCcCCc...ccccC +

@@ -436,122 +428,114 @@ exports[`TypedSignInfo renders origin for typed sign data request 1`] = ` exports[`TypedSignInfo should render message for typed sign v3 request 1`] = `
-
-

+

+
- Request from -

-
-
- -
+
-
+
+

-

- metamask.github.io -

-
+ metamask.github.io +

-
-

- Interacting with -

-
+ Interacting with +

+
+
-

- 0xCcCCc...ccccC -

+

+ 0xCcCCc...ccccC +

@@ -867,122 +851,114 @@ exports[`TypedSignInfo should render message for typed sign v3 request 1`] = ` exports[`TypedSignInfo should render message for typed sign v4 request 1`] = `
-
-

+

+
- Request from -

-
-
- -
+
-
+
+

-

- metamask.github.io -

-
+ metamask.github.io +

-
-

- Interacting with -

-
+ Interacting with +

+
+
-

- 0xCcCCc...ccccC -

+

+ 0xCcCCc...ccccC +

diff --git a/ui/pages/confirmations/confirm/__snapshots__/confirm.test.tsx.snap b/ui/pages/confirmations/confirm/__snapshots__/confirm.test.tsx.snap index c28f6bec6360..89ac8f62ae1c 100644 --- a/ui/pages/confirmations/confirm/__snapshots__/confirm.test.tsx.snap +++ b/ui/pages/confirmations/confirm/__snapshots__/confirm.test.tsx.snap @@ -111,19 +111,6 @@ exports[`Confirm matches snapshot for personal signature type 1`] = `
-
- -

- Your selected account (0x0dcd5...3e7bc) is different than the account trying to sign () -

-
-
- -

- Your selected account (0x0dcd5...3e7bc) is different than the account trying to sign () -

-
-
-

+

+
- Request from -

-
-
- -
+
-
+
+

-

- metamask.github.io -

-
+ metamask.github.io +

-
-

- Interacting with -

-
+ Interacting with +

+
+
-

- 0xCcCCc...ccccC -

+

+ 0xCcCCc...ccccC +