From 7a76c2751ccf723fb4c85ec393aee17362825d86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ant=C3=B3nio=20Regadas?= Date: Tue, 20 Feb 2024 11:08:52 +0000 Subject: [PATCH 1/5] MMI skipping until we move to sepolia (#23064) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## **Description** Skipping these tests until we finish moving to Sepolia. ## **Related issues** Fixes: ## **Manual testing steps** 1. Go to this page... 2. 3. ## **Screenshots/Recordings** ### **Before** ### **After** ## **Pre-merge author checklist** - [ ] I’ve followed [MetaMask Coding Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md). - [ ] I've clearly explained what problem this PR is solving and how it is solved. - [ ] I've linked related issues - [ ] I've included manual testing steps - [ ] I've included screenshots/recordings if applicable - [ ] I’ve included tests if applicable - [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [ ] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. - [ ] I’ve properly set the pull request status: - [ ] In case it's not yet "ready for review", I've set it to "draft". - [ ] In case it's "ready for review", I've changed it from "draft" to "non-draft". ## **Pre-merge reviewer checklist** - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots. --- test/e2e/mmi/specs/extension.visual.spec.ts | 2 +- test/e2e/mmi/specs/transactions.spec.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/e2e/mmi/specs/extension.visual.spec.ts b/test/e2e/mmi/specs/extension.visual.spec.ts index cb0bb9d88896..1f2176cf6b0b 100644 --- a/test/e2e/mmi/specs/extension.visual.spec.ts +++ b/test/e2e/mmi/specs/extension.visual.spec.ts @@ -76,7 +76,7 @@ test.describe('MMI extension', () => { ); }); - test('Custodian token management', async ({ page, context }) => { + test.skip('Custodian token management', async ({ page, context }) => { // Define const to compare in assertions const arrayWithoutCustodianAccounts = ['Account 1']; const arrayWithCustodianAccounts = [ diff --git a/test/e2e/mmi/specs/transactions.spec.ts b/test/e2e/mmi/specs/transactions.spec.ts index ecaeff9434c4..4cd6dab45361 100644 --- a/test/e2e/mmi/specs/transactions.spec.ts +++ b/test/e2e/mmi/specs/transactions.spec.ts @@ -72,7 +72,7 @@ const sendTransaction = async ( }; test.describe('MMI send', () => { - test('Send a transaction from one account to another and confirm it from custody', async ({ + test.skip('Send a transaction from one account to another and confirm it from custody', async ({ page, context, }) => { From 61b5a1917d364fb765d61c0b0b20a1917b43e300 Mon Sep 17 00:00:00 2001 From: Ariella Vu <20778143+digiwand@users.noreply.github.com> Date: Tue, 20 Feb 2024 07:58:26 -0700 Subject: [PATCH 2/5] Fix: settings search for Security Alerts; Feat: Add Blockaid and OpenSea "Security & privacy" settings search; Feat: Add Nicknames and Snaps "Experimental" settings search (#22967) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## **Description** - Fixes issue where previously, searching "Security Alerts" would redirect to the Experimental Tab. Now it redirects to the "Security & privacy" tab - Adds Blockaid and OpenSea "Security & privacy" settings search - Adds "Experimental" setting searches. Prolongs e2e experimental test by adding experimental settings searches. There were references placed in experimental-tab.component.js, but no references created in constants/settings.js. This PR enables searching for the following settings: - Allow Nicknames - Snaps ## **Related issues** Fixes: https://github.com/MetaMask/metamask-extension/issues/22870 ## **Manual testing steps** 1. Go to Settings 2. Use search bar to search relevant settings ## **Screenshots/Recordings** ### **Before** ### **After** #### Fix Screenshot 2024-02-14 at 10 40 13 PM #### New searchable Blockaid and OpenSea Screenshot 2024-02-14 at 10 12 37 PM #### New searchable Nicknames ![Screenshot 2024-02-16 at 10 05 46 AM](https://github.com/MetaMask/metamask-extension/assets/20778143/af38f130-5184-429f-827a-e39caf1d1b18) #### New searchable Snaps ![Screenshot 2024-02-16 at 10 45 19 AM](https://github.com/MetaMask/metamask-extension/assets/20778143/6cfbd632-6e7e-403d-b7d8-d1fb24edca1c) ## **Pre-merge author checklist** - [ ] I’ve followed [MetaMask Coding Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md). - [ ] I've clearly explained what problem this PR is solving and how it is solved. - [ ] I've linked related issues - [ ] I've included manual testing steps - [ ] I've included screenshots/recordings if applicable - [ ] I’ve included tests if applicable - [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [ ] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. - [ ] I’ve properly set the pull request status: - [ ] In case it's not yet "ready for review", I've set it to "draft". - [ ] In case it's "ready for review", I've changed it from "draft" to "non-draft". ## **Pre-merge reviewer checklist** - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots. --- test/e2e/tests/settings-search.spec.js | 4 +- ui/helpers/constants/settings.js | 50 +++++++++++++++---- ui/helpers/utils/settings-search.test.js | 6 +-- .../__snapshots__/security-tab.test.js.snap | 1 + .../security-tab/security-tab.component.js | 7 ++- 5 files changed, 53 insertions(+), 15 deletions(-) diff --git a/test/e2e/tests/settings-search.spec.js b/test/e2e/tests/settings-search.spec.js index bffe62f7d18f..73572a6da761 100644 --- a/test/e2e/tests/settings-search.spec.js +++ b/test/e2e/tests/settings-search.spec.js @@ -14,7 +14,7 @@ describe('Settings Search', function () { security: 'Reveal Secret', alerts: 'Browsing a website', networks: 'Ethereum Mainnet', - experimental: 'Security alerts', + experimental: 'Nicknames', about: 'Terms of Use', }; @@ -98,7 +98,7 @@ describe('Settings Search', function () { }, ); }); - it('should find element inside the Security tab', async function () { + it('should find element inside the "Security & privacy" tab', async function () { await withFixtures( { fixtures: new FixtureBuilder().build(), diff --git a/ui/helpers/constants/settings.js b/ui/helpers/constants/settings.js index 73e63331ea0f..f4dce45a1ed5 100644 --- a/ui/helpers/constants/settings.js +++ b/ui/helpers/constants/settings.js @@ -263,11 +263,30 @@ export const SETTINGS_CONSTANTS = [ route: `${SECURITY_ROUTE}#proposed-nicknames`, icon: 'fa fa-lock', }, - /** - * settingsRefs 15-17 will be handled in a future PR - * - * @see {@link https://github.com/MetaMask/metamask-extension/pull/22967} - */ + // securityAndPrivacy settingsRefs[15] + { + tabMessage: (t) => t('securityAndPrivacy'), + sectionMessage: (t) => t('securityAlerts'), + descriptionMessage: (t) => t('securityAlertsDescription'), + route: `${SECURITY_ROUTE}#security-alerts`, + icon: 'fa fa-lock', + }, + // securityAndPrivacy settingsRefs[16] + { + tabMessage: (t) => t('securityAndPrivacy'), + sectionMessage: (t) => t('blockaid'), + descriptionMessage: (t) => t('blockaidMessage'), + route: `${SECURITY_ROUTE}#security-alerts-blockaid`, + icon: 'fa fa-lock', + }, + // securityAndPrivacy settingsRefs[17] + { + tabMessage: (t) => t('securityAndPrivacy'), + sectionMessage: (t) => t('openSeaLabel'), + descriptionMessage: (t) => t('openSeaMessage'), + route: `${SECURITY_ROUTE}#security-alerts-opensea`, + icon: 'fa fa-lock', + }, { tabMessage: (t) => t('alerts'), sectionMessage: (t) => t('alertSettingsUnconnectedAccount'), @@ -405,11 +424,24 @@ export const SETTINGS_CONSTANTS = [ route: `${ADVANCED_ROUTE}#restore-userdata`, icon: 'fas fa-upload', }, + // experimental settingsRefs[0] { tabMessage: (t) => t('experimental'), - sectionMessage: (t) => t('securityAlerts'), - descriptionMessage: (t) => t('securityAlertsDescription'), - route: `${EXPERIMENTAL_ROUTE}#security-alerts`, - icon: 'fa fa-flask', + sectionMessage: (t) => t('petnamesEnabledToggle'), + descriptionMessage: (t) => t('petnamesEnabledToggleDescription'), + route: `${EXPERIMENTAL_ROUTE}#nicknames`, + icon: 'fas fa-flask', + }, + + ///: BEGIN:ONLY_INCLUDE_IF(keyring-snaps) + // since this route is only included with keyring-snaps feature flag, this needs to be the last settingsRef for the experimental tab + // experimental settingsRefs[1] + { + tabMessage: (t) => t('experimental'), + sectionMessage: (t) => t('snaps'), + descriptionMessage: (t) => t('addSnapAccountToggle'), + route: `${EXPERIMENTAL_ROUTE}#snaps`, + icon: 'fas fa-flask', }, + ///: END:ONLY_INCLUDE_IF ]; diff --git a/ui/helpers/utils/settings-search.test.js b/ui/helpers/utils/settings-search.test.js index d9ccc7aa4e5e..db70cd424873 100644 --- a/ui/helpers/utils/settings-search.test.js +++ b/ui/helpers/utils/settings-search.test.js @@ -159,10 +159,10 @@ describe('Settings Search Utils', () => { expect(getNumberOfSettingRoutesInTab(t, t('contacts'))).toStrictEqual(1); }); - it('returns "Security & Privacy" section count', () => { + it('returns "Security & privacy" section count', () => { expect( getNumberOfSettingRoutesInTab(t, t('securityAndPrivacy')), - ).toStrictEqual(15); + ).toStrictEqual(18); }); it('returns "Alerts" section count', () => { @@ -175,7 +175,7 @@ describe('Settings Search Utils', () => { it('returns "Experimental" section count', () => { expect(getNumberOfSettingRoutesInTab(t, t('experimental'))).toStrictEqual( - 1, + 2, ); }); diff --git a/ui/pages/settings/security-tab/__snapshots__/security-tab.test.js.snap b/ui/pages/settings/security-tab/__snapshots__/security-tab.test.js.snap index 9af844718645..a6c2d73e6633 100644 --- a/ui/pages/settings/security-tab/__snapshots__/security-tab.test.js.snap +++ b/ui/pages/settings/security-tab/__snapshots__/security-tab.test.js.snap @@ -34,6 +34,7 @@ exports[`Security Tab should match snapshot 1`] = `
+ diff --git a/ui/pages/settings/security-tab/security-tab.component.js b/ui/pages/settings/security-tab/security-tab.component.js index d6ea786b8a77..150702b80e25 100644 --- a/ui/pages/settings/security-tab/security-tab.component.js +++ b/ui/pages/settings/security-tab/security-tab.component.js @@ -201,7 +201,12 @@ export default class SecurityTab extends PureComponent { ref={this.settingsRefs[15]} className="settings-page__security-tab-sub-header" > - + + {t('securityAlerts')}
From 030786af59d5e8b5c10bfdc377b7dc718d415a8d Mon Sep 17 00:00:00 2001 From: Ariella Vu <20778143+digiwand@users.noreply.github.com> Date: Tue, 20 Feb 2024 08:29:12 -0700 Subject: [PATCH 3/5] fix: Blockaid disable disclosure scrollToBottom (#22932) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## **Description** Replaces default Disclosure scrollToBottom behavior to fix issue where opening Blockaid Banner Alert "See Details" would scroll to the bottom Adds tests for Disclosure component ## **Related issues** Fixes: https://github.com/MetaMask/metamask-extension/issues/21187 ## **Manual testing steps** ## **Screenshots/Recordings** ### **Before** ![sdlg5Rty3W](https://github.com/MetaMask/metamask-extension/assets/20778143/6d74bb25-09f7-406f-a75d-73664f4d6e2d) ### **After** ![ZHn0VM0UwG](https://github.com/MetaMask/metamask-extension/assets/20778143/a12a31fe-90e1-4f5b-92ec-a83ad957b994) ## **Pre-merge author checklist** - [ ] I’ve followed [MetaMask Coding Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md). - [ ] I've clearly explained what problem this PR is solving and how it is solved. - [ ] I've linked related issues - [ ] I've included manual testing steps - [ ] I've included screenshots/recordings if applicable - [ ] I’ve included tests if applicable - [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [ ] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. - [ ] I’ve properly set the pull request status: - [ ] In case it's not yet "ready for review", I've set it to "draft". - [ ] In case it's "ready for review", I've changed it from "draft" to "non-draft". ## **Pre-merge reviewer checklist** - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots. --- ...transaction-list-item-details.component.js | 6 +- .../__snapshots__/disclosure.test.js.snap | 41 ++++++++++ ui/components/ui/disclosure/disclosure.js | 24 ++++-- .../ui/disclosure/disclosure.test.js | 80 +++++++++++++++++++ ...ecurity-provider-banner-alert.test.js.snap | 2 + .../blockaid-banner-alert.test.js.snap | 6 ++ 6 files changed, 151 insertions(+), 8 deletions(-) create mode 100644 ui/components/ui/disclosure/__snapshots__/disclosure.test.js.snap create mode 100644 ui/components/ui/disclosure/disclosure.test.js diff --git a/ui/components/app/transaction-list-item-details/transaction-list-item-details.component.js b/ui/components/app/transaction-list-item-details/transaction-list-item-details.component.js index c5037ff5c93d..e2fe8769b969 100644 --- a/ui/components/app/transaction-list-item-details/transaction-list-item-details.component.js +++ b/ui/components/app/transaction-list-item-details/transaction-list-item-details.component.js @@ -380,7 +380,11 @@ export default class TransactionListItemDetails extends PureComponent { } {transactionGroup.initialTransaction.type !== TransactionType.incoming && ( - + +
+
+ + + Test Title + +
+ Test +
+
+
+
+`; + +exports[`Disclosure matches snapshot without title prop 1`] = ` +
+
+ Test +
+
+`; diff --git a/ui/components/ui/disclosure/disclosure.js b/ui/components/ui/disclosure/disclosure.js index 297646c0956a..30d4bbb76192 100644 --- a/ui/components/ui/disclosure/disclosure.js +++ b/ui/components/ui/disclosure/disclosure.js @@ -47,24 +47,32 @@ const renderSummaryByType = (variant, title, size) => { } }; -const Disclosure = ({ children, title, size, variant }) => { +const Disclosure = ({ + children, + isScrollToBottomOnOpen, + title, + size, + variant, +}) => { const disclosureFooterEl = useRef(null); const [open, setOpen] = useState(false); const scrollToBottom = () => { - disclosureFooterEl && - disclosureFooterEl.current && - disclosureFooterEl.current.scrollIntoView({ behavior: 'smooth' }); + disclosureFooterEl?.current?.scrollIntoView({ behavior: 'smooth' }); }; useEffect(() => { - if (open) { + if (isScrollToBottomOnOpen && open) { scrollToBottom(); } - }, [open]); + }, [isScrollToBottomOnOpen, open]); return ( -
setOpen((state) => !state)}> +
setOpen((state) => !state)} + > {title ? (
{renderSummaryByType(variant, title)} @@ -83,12 +91,14 @@ const Disclosure = ({ children, title, size, variant }) => { Disclosure.propTypes = { children: PropTypes.node.isRequired, + isScrollToBottomOnOpen: PropTypes.bool, size: PropTypes.string, title: PropTypes.string, variant: PropTypes.string, }; Disclosure.defaultProps = { + isScrollToBottomOnOpen: false, size: 'normal', title: null, variant: DisclosureVariant.Default, diff --git a/ui/components/ui/disclosure/disclosure.test.js b/ui/components/ui/disclosure/disclosure.test.js new file mode 100644 index 000000000000..b659e1aae8d1 --- /dev/null +++ b/ui/components/ui/disclosure/disclosure.test.js @@ -0,0 +1,80 @@ +import React from 'react'; +import { fireEvent, render } from '@testing-library/react'; +import Disclosure from './disclosure'; + +describe('Disclosure', () => { + it('matches snapshot without title prop', () => { + const { container } = render(Test); + expect(container).toMatchSnapshot(); + }); + + it('matches snapshot with title prop', () => { + const { container } = render( + + Test + , + ); + expect(container).toMatchSnapshot(); + }); + + it('renders content', () => { + const { container, getByText, rerender } = render( + Test, + ); + expect(getByText('Test Title')).toBeInTheDocument(); + expect(container.querySelector('.disclosure__content').textContent).toBe( + 'Test', + ); + + expect( + container.querySelector('.disclosure__content.normal'), + ).toBeInTheDocument(); + + rerender( + + Test + , + ); + + expect( + container.querySelector('.disclosure__content.small'), + ).toBeInTheDocument(); + }); + + describe('when clicking on disclosure', () => { + it('does not scroll down on open by default or when isScrollToBottomOnOpen is false', () => { + const mockScrollIntoView = jest.fn(); + const originalScrollIntoView = + window.HTMLElement.prototype.scrollIntoView; + window.HTMLElement.prototype.scrollIntoView = mockScrollIntoView; + + const { getByTestId } = render( + Test, + ); + const element = getByTestId('disclosure'); + fireEvent.click(element); + expect(mockScrollIntoView).not.toHaveBeenCalled(); + window.HTMLElement.prototype.scrollIntoView = originalScrollIntoView; + }); + + it('scrolls down on open when isScrollToBottomOnOpen is true', () => { + const mockScrollIntoView = jest.fn(); + const originalScrollIntoView = + window.HTMLElement.prototype.scrollIntoView; + window.HTMLElement.prototype.scrollIntoView = mockScrollIntoView; + + const { getByTestId } = render( + + Test + , + ); + const element = getByTestId('disclosure'); + + fireEvent.click(element); + expect(mockScrollIntoView).toHaveBeenCalledWith({ + behavior: 'smooth', + }); + window.HTMLElement.prototype.scrollIntoView = originalScrollIntoView; + }); + }); +}); diff --git a/ui/pages/confirmations/components/security-provider-banner-alert/__snapshots__/security-provider-banner-alert.test.js.snap b/ui/pages/confirmations/components/security-provider-banner-alert/__snapshots__/security-provider-banner-alert.test.js.snap index 5981db85d4c0..7a17475bdde3 100644 --- a/ui/pages/confirmations/components/security-provider-banner-alert/__snapshots__/security-provider-banner-alert.test.js.snap +++ b/ui/pages/confirmations/components/security-provider-banner-alert/__snapshots__/security-provider-banner-alert.test.js.snap @@ -25,6 +25,7 @@ exports[`Security Provider Banner Alert should match snapshot 1`] = `

Date: Tue, 20 Feb 2024 09:28:16 -0700 Subject: [PATCH 4/5] style:fix: Remove background behind setting icons (#22982) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## **Description** removing the barely visible background behind setting icons ## **Related issues** Fixes: https://github.com/MetaMask/metamask-extension/issues/22981 ## **Manual testing steps** 1. Go to settings 2. Search a setting 3. Observe barely visible background behind icons in both light and dark mode ## **Screenshots/Recordings** ### **Before** Screenshot 2024-02-14 at 10 20 41 PM Screenshot 2024-02-14 at 10 48 25 PM ### **After** (ignore "Security" instead of "Security & Privacy" copy Screenshot 2024-02-14 at 10 49 04 PM Screenshot 2024-02-14 at 10 48 31 PM ## **Pre-merge author checklist** - [ ] I’ve followed [MetaMask Coding Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md). - [ ] I've clearly explained what problem this PR is solving and how it is solved. - [ ] I've linked related issues - [ ] I've included manual testing steps - [ ] I've included screenshots/recordings if applicable - [ ] I’ve included tests if applicable - [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [ ] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. - [ ] I’ve properly set the pull request status: - [ ] In case it's not yet "ready for review", I've set it to "draft". - [ ] In case it's "ready for review", I've changed it from "draft" to "non-draft". ## **Pre-merge reviewer checklist** - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots. --- ui/pages/settings/index.scss | 1 - 1 file changed, 1 deletion(-) diff --git a/ui/pages/settings/index.scss b/ui/pages/settings/index.scss index c69b05861fbc..ec06ed6c994b 100644 --- a/ui/pages/settings/index.scss +++ b/ui/pages/settings/index.scss @@ -95,7 +95,6 @@ gap: 8px; &__icon { - background: var(--color-background-alternative); height: 15px; width: 15px; margin-right: 16px; From 3e3acf59bad480ecf69c85520e5ec75315e33cf2 Mon Sep 17 00:00:00 2001 From: seaona <54408225+seaona@users.noreply.github.com> Date: Tue, 20 Feb 2024 17:30:49 +0100 Subject: [PATCH 5/5] test: add scenario sign typed v4 with hardware wallet (#23043) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## **Description** In this PR we add the scenario for the flow: sign typed v4 with hardware wallet. This task belongs to the effort of documenting manual QA flows[ in this Epic](https://github.com/MetaMask/metamask-extension/issues/21962). ## **Related issues** Fixes: https://github.com/MetaMask/metamask-extension/issues/22029 ## **Manual testing steps** 1. Check steps are coherent with the flow in the video Note: You can see the table rendered [here](https://github.com/MetaMask/metamask-extension/blob/test-scenario-sign4-hw/test/scenarios/13.%20sign/sign%20typed%20data%20v4%20with%20hardware%20wallet.csv) for an easier review ## **Screenshots/Recordings** Performing the steps defined in the scenario https://github.com/MetaMask/metamask-extension/assets/54408225/766be1d0-77dd-4d5c-8f4d-d2b2f3d384fb ## **Pre-merge author checklist** - [x] I’ve followed [MetaMask Coding Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md). - [x] I've clearly explained what problem this PR is solving and how it is solved. - [x] I've linked related issues - [x] I've included manual testing steps - [x] I've included screenshots/recordings if applicable - [x] I’ve included tests if applicable - [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [x] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. - [x] I’ve properly set the pull request status: - [ ] In case it's not yet "ready for review", I've set it to "draft". - [ ] In case it's "ready for review", I've changed it from "draft" to "non-draft". ## **Pre-merge reviewer checklist** - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots. --- ...ign typed data v4 with hardware wallet.csv | 21 +++++++++++++++++++ .../2. keyring/connect hardware wallet.csv | 2 +- 2 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 test/scenarios/13. sign/sign typed data v4 with hardware wallet.csv diff --git a/test/scenarios/13. sign/sign typed data v4 with hardware wallet.csv b/test/scenarios/13. sign/sign typed data v4 with hardware wallet.csv new file mode 100644 index 000000000000..e7a851260ecf --- /dev/null +++ b/test/scenarios/13. sign/sign typed data v4 with hardware wallet.csv @@ -0,0 +1,21 @@ +Steps,Test Steps,Preconditions,Test Data,Expected Result,Notes +1,Open the extension.,,,The Welcome Back screen is shown., +2,Proceed to Unlock the wallet.,,password (8 characters min).,"The Ether balance is shown on the overview. +The wallet address is shown on the overview.", +3,"Click on account menu icon. Click ""Add account or hardware wallet"".",,,"The ""Add account"" modal is shown.", +4,"On ""Add account"" modal, click ""Add hardware wallet"" button.",,,"""Connect a hardware wallet"" screen is shown. User can choose between different options to connect a hardware: Ledger, Trezor, Lattice, or QR-based. ""Continue"" button is disabled.", +5,Choose an option to connect hardware wallet.,We need to have a hardware wallet set up to test this functionality.,"e.g. choose ""Ledger""","""Continue"" button is enabled.", +6,"Plug the hardware wallet directly into computer, then unlock it.",,Password for hardware wallet,"Hardware wallet is detected by MetaMask. ""Select an account"" screen is shown on MetaMask, accounts on hardware wallet are shown on this screen.","If you use Ledger, you need to open the Ethereum app on Ledger. If you use Trezor, make sure you use the correct passphrase." +7,"Choose one or multiples accounts that user wants to connect. Then click ""Unlock"".",,,, +8,Click account menu icon to open accounts list.,,,"In accounts list, all selected hardware wallet accounts are shown, and they are all flagged with harware wallet name to be distinguished from other accounts.", +9,Select one hardware wallet account.,,,"The Ether balance for the selected hardware wallet account is shown on the overview. +The selected account address is shown on the overview.", +10,Open the test dapp in another tab.,,https://metamask.github.io/test-dapp/,, +11,Click Connect.,,,"The MetaMask popup is opened with the Connect with MetaMask screen displayed. +Your imported hardware wallet account is selected.", +12,Click Next and Connect with the hardware wallet account.,,,"The MetaMask popup is closed. +You are connected to the test dapp.", +13,"Click ""Sign Typed Data V4"".",,,"The info modal instructions for signing with hardware wallet is displayed. +The signature message is in JSON formatting.", +14,Accept the Signature in the hardware wallet device.,,,The signature hash is displayed on the test dapp., +15,Verify signed hash.,,,The signed address is correctly verified.,The address shown in the test dapp is the same as the hardware wallet account. diff --git a/test/scenarios/2. keyring/connect hardware wallet.csv b/test/scenarios/2. keyring/connect hardware wallet.csv index 636a6df04ab8..fa11b9f58ced 100644 --- a/test/scenarios/2. keyring/connect hardware wallet.csv +++ b/test/scenarios/2. keyring/connect hardware wallet.csv @@ -4,7 +4,7 @@ Step,Test steps,Preconditions,Test data,Expected result,Notes 3,"Keep Ethereum Mainnet as the selected network. Click on account menu icon. Click ""Add account or hardware wallet"".",,,"The ""Add account"" modal is shown.", 4,"On ""Add account"" modal, click ""Add hardware wallet"" button.",,,"""Connect a hardware wallet"" screen is shown. User can choose between different options to connect a hardware: Ledger, Trezor, Lattice, or QR-based. ""Continue"" button is disabled.", 5,Choose an option to connect hardware wallet.,We need to have a hardware wallet setted up to test this functionality.,"e.g. choose ""Ledger""","""Continue"" button is enabled.", -6,"Plug the hardware wallet directly into computer, then unlock it.",,password for hardware wallet,"Hardware wallet is detected by MetaMask. ""Select an account"" screen is shown on MetaMask, accounts on hardware wallet are shown on this screen.","If you use Ledger, you need to open the Ethereum app on Ledger. If you use Trazor, make sure you use the correct passphrase." +6,"Plug the hardware wallet directly into computer, then unlock it.",,password for hardware wallet,"Hardware wallet is detected by MetaMask. ""Select an account"" screen is shown on MetaMask, accounts on hardware wallet are shown on this screen.","If you use Ledger, you need to open the Ethereum app on Ledger. If you use Trezor, make sure you use the correct passphrase." 7,"Choose one or multiples accounts that user wants to connect. Then click ""Unlock"".",,,, 8,Click account menu icon to open accounts list.,,,"In accounts list, all selected hardware wallet accounts are shown, and they are all flagged with harware wallet name to be distinguished from other accounts.", 9,"Select one hardware wallet account. ",,,"The Ether balance for the selected hardware wallet account is shown on the overview. The selected account address is shown on the overview. The selected network is Ethereum Mainnet. ", \ No newline at end of file