From 8404b8a3fc1fcb7478cf7749e321da352edac6d1 Mon Sep 17 00:00:00 2001
From: Mark Stacey
Date: Fri, 30 Jun 2023 13:01:17 -0230
Subject: [PATCH 001/351] Allow partially re-running a policy update (#19773)
Today if you try to re-run failed jobs in a policy update, it will
fail to restore caches from jobs that were successful. This could
result in a partial update, or a misleading "No policy changes"
message when there are policy changes to make. It's only safe to re-
run the entire workflow.
The cache key has been updated to reference the commit hash instead of
the run ID, making it safe to re-run just the failed jobs.
---
.../workflows/update-lavamoat-policies.yml | 25 +++++++++++++------
1 file changed, 17 insertions(+), 8 deletions(-)
diff --git a/.github/workflows/update-lavamoat-policies.yml b/.github/workflows/update-lavamoat-policies.yml
index 3d26c2033..5f2814e97 100644
--- a/.github/workflows/update-lavamoat-policies.yml
+++ b/.github/workflows/update-lavamoat-policies.yml
@@ -48,6 +48,8 @@ jobs:
needs: is-fork-pull-request
# Early exit if this is a fork, since later steps are skipped for forks
if: ${{ needs.is-fork-pull-request.outputs.IS_FORK == 'false' }}
+ outputs:
+ COMMIT_SHA: ${{ steps.commit-sha.outputs.COMMIT_SHA }}
steps:
- name: Checkout repository
uses: actions/checkout@v3
@@ -63,6 +65,9 @@ jobs:
cache: 'yarn'
- name: Install Yarn dependencies
run: yarn --immutable
+ - name: Get commit SHA
+ id: commit-sha
+ run: echo "COMMIT_SHA=$(git rev-parse --short HEAD)" >> "$GITHUB_OUTPUT"
update-lavamoat-build-policy:
name: Update LavaMoat build policy
@@ -90,7 +95,7 @@ jobs:
uses: actions/cache/save@v3
with:
path: lavamoat/build-system
- key: cache-build-${{ github.run_id }}-${{ github.run_attempt }}
+ key: cache-build-${{ needs.prepare.outputs.COMMIT_SHA }}
update-lavamoat-webapp-policy:
strategy:
@@ -125,12 +130,13 @@ jobs:
uses: actions/cache/save@v3
with:
path: lavamoat/browserify/${{ matrix.build-type }}
- key: cache-${{ matrix.build-type }}-${{ github.run_id }}-${{ github.run_attempt }}
+ key: cache-${{ matrix.build-type }}-${{ needs.prepare.outputs.COMMIT_SHA }}
commit-updated-policies:
name: Commit the updated LavaMoat policies
runs-on: ubuntu-latest
needs:
+ - prepare
- is-fork-pull-request
- update-lavamoat-build-policy
- update-lavamoat-webapp-policy
@@ -147,11 +153,14 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.LAVAMOAT_UPDATE_TOKEN }}
PR_NUMBER: ${{ github.event.issue.number }}
+ - name: Get commit SHA
+ id: commit-sha
+ run: echo "COMMIT_SHA=$(git rev-parse --short HEAD)" >> "$GITHUB_OUTPUT"
- name: Restore build policy
uses: actions/cache/restore@v3
with:
path: lavamoat/build-system
- key: cache-build-${{ github.run_id }}-${{ github.run_attempt }}
+ key: cache-build-${{ needs.prepare.outputs.COMMIT_SHA }}
fail-on-cache-miss: true
# One restore step per build type: [main, beta, flask, mmi, desktop]
# Ensure this is synchronized with the list above in the "update-lavamoat-webapp-policy" job
@@ -160,31 +169,31 @@ jobs:
uses: actions/cache/restore@v3
with:
path: lavamoat/browserify/main
- key: cache-main-${{ github.run_id }}-${{ github.run_attempt }}
+ key: cache-main-${{ needs.prepare.outputs.COMMIT_SHA }}
fail-on-cache-miss: true
- name: Restore beta application policy
uses: actions/cache/restore@v3
with:
path: lavamoat/browserify/beta
- key: cache-beta-${{ github.run_id }}-${{ github.run_attempt }}
+ key: cache-beta-${{ needs.prepare.outputs.COMMIT_SHA }}
fail-on-cache-miss: true
- name: Restore flask application policy
uses: actions/cache/restore@v3
with:
path: lavamoat/browserify/flask
- key: cache-flask-${{ github.run_id }}-${{ github.run_attempt }}
+ key: cache-flask-${{ needs.prepare.outputs.COMMIT_SHA }}
fail-on-cache-miss: true
- name: Restore mmi application policy
uses: actions/cache/restore@v3
with:
path: lavamoat/browserify/mmi
- key: cache-mmi-${{ github.run_id }}-${{ github.run_attempt }}
+ key: cache-mmi-${{ needs.prepare.outputs.COMMIT_SHA }}
fail-on-cache-miss: true
- name: Restore desktop application policy
uses: actions/cache/restore@v3
with:
path: lavamoat/browserify/desktop
- key: cache-desktop-${{ github.run_id }}-${{ github.run_attempt }}
+ key: cache-desktop-${{ needs.prepare.outputs.COMMIT_SHA }}
fail-on-cache-miss: true
- name: Check whether there are policy changes
id: policy-changes
From a41219ceb8bc9572ef83a8400b8d97824589e2e6 Mon Sep 17 00:00:00 2001
From: Garrett Bear
Date: Fri, 30 Jun 2023 11:35:43 -0700
Subject: [PATCH 002/351] Update Design Tokens & Add New Text Variants (#19853)
* update button font weight to medium
* update design-tokens and add new Text medium
* undo button base weight change
* fix unused import
* update snapshot
* fix yarn dedupe
* update readme
---
.storybook/3.COLORS.stories.mdx | 6 ++++++
package.json | 2 +-
.../component-library/button-base/button-base.js | 4 ++--
ui/components/component-library/text/README.mdx | 6 ++++++
.../text/__snapshots__/text.test.tsx.snap | 15 +++++++++++++++
ui/components/component-library/text/text.scss | 2 +-
.../component-library/text/text.test.tsx | 6 ++++++
.../component-library/text/text.types.ts | 3 +++
ui/helpers/constants/design-system.ts | 3 +++
yarn.lock | 10 +++++-----
10 files changed, 48 insertions(+), 9 deletions(-)
diff --git a/.storybook/3.COLORS.stories.mdx b/.storybook/3.COLORS.stories.mdx
index fce6ef662..c7a379d53 100644
--- a/.storybook/3.COLORS.stories.mdx
+++ b/.storybook/3.COLORS.stories.mdx
@@ -50,7 +50,13 @@ Theme colors are color agnostic, semantically neutral and theme compatible desig
```css
/** Backgrounds */
var(--color-background-default)
+var(--color-background-default-hover)
+var(--color-background-default-pressed)
var(--color-background-alternative)
+var(--color-background-alternative-hover)
+var(--color-background-alternative-pressed)
+var(--color-background-hover)
+var(--color-background-pressed)
/** Text */
var(--color-text-default)
diff --git a/package.json b/package.json
index 123d68999..eb8e18f1b 100644
--- a/package.json
+++ b/package.json
@@ -230,7 +230,7 @@
"@metamask/browser-passworder": "^4.1.0",
"@metamask/contract-metadata": "^2.3.1",
"@metamask/controller-utils": "^4.0.1",
- "@metamask/design-tokens": "^1.9.0",
+ "@metamask/design-tokens": "^1.12.0",
"@metamask/desktop": "^0.3.0",
"@metamask/eth-json-rpc-middleware": "^11.0.0",
"@metamask/eth-keyring-controller": "^10.0.1",
diff --git a/ui/components/component-library/button-base/button-base.js b/ui/components/component-library/button-base/button-base.js
index 21a9e681d..5d38c3d57 100644
--- a/ui/components/component-library/button-base/button-base.js
+++ b/ui/components/component-library/button-base/button-base.js
@@ -8,7 +8,7 @@ import { Text } from '../text';
import {
AlignItems,
- DISPLAY,
+ Display,
JustifyContent,
TextColor,
TextVariant,
@@ -65,7 +65,7 @@ export const ButtonBase = ({
className,
)}
disabled={disabled}
- display={DISPLAY.INLINE_FLEX}
+ display={Display.InlineFlex}
justifyContent={JustifyContent.center}
alignItems={AlignItems.center}
borderRadius={BorderRadius.pill}
diff --git a/ui/components/component-library/text/README.mdx b/ui/components/component-library/text/README.mdx
index 6d4fd47a8..986673039 100644
--- a/ui/components/component-library/text/README.mdx
+++ b/ui/components/component-library/text/README.mdx
@@ -31,9 +31,12 @@ Use the `variant` prop and the `TextVariant` enum from `./ui/helpers/constants/d
- TextVariant.bodyLgMedium (default renders as `p` tag)
- TextVariant.bodyMd (default renders as `p` tag)
- TextVariant.bodyMdBold (default renders as `p` tag)
+- TextVariant.bodyMdMedium (default renders as `p` tag)
- TextVariant.bodySm (default renders as `p` tag)
+- TextVariant.bodySmMedium (default renders as `p` tag)
- TextVariant.bodySmBold (default renders as `p` tag)
- TextVariant.bodyXs (default renders as `p` tag)
+- TextVariant.bodyXsMedium (default renders as `p` tag)
- TextVariant.inherit (default renders as `span` tag)
+
+ body-md-medium
+
@@ -42,6 +47,11 @@ exports[`Text should render the Text with proper variant class name 1`] = `
>
body-sm
+
+ body-sm-medium
+
@@ -52,5 +62,10 @@ exports[`Text should render the Text with proper variant class name 1`] = `
>
body-xs
+
+ body-xs-medium
+
`;
diff --git a/ui/components/component-library/text/text.scss b/ui/components/component-library/text/text.scss
index 9726f7f2b..2185ea659 100644
--- a/ui/components/component-library/text/text.scss
+++ b/ui/components/component-library/text/text.scss
@@ -4,7 +4,7 @@
$text-variants: (
display: ("md"),
heading: ( "sm", "md", "lg"),
- body: ("xs", "sm", "sm-bold", "md", "md-bold", "lg-medium"),
+ body: ("xs", "xs-medium", "sm", "sm-medium", "sm-bold", "md", "md-medium", "md-bold", "lg-medium"),
);
// Variable output mixin
diff --git a/ui/components/component-library/text/text.test.tsx b/ui/components/component-library/text/text.test.tsx
index 1a22db879..2de6ce764 100644
--- a/ui/components/component-library/text/text.test.tsx
+++ b/ui/components/component-library/text/text.test.tsx
@@ -76,10 +76,13 @@ describe('Text', () => {
heading-smbody-lg-mediumbody-md
+ body-md-mediumbody-md-boldbody-sm
+ body-sm-mediumbody-sm-boldbody-xs
+ body-xs-medium
>,
);
@@ -89,10 +92,13 @@ describe('Text', () => {
expect(getByText('heading-sm')).toHaveClass('mm-text--heading-sm');
expect(getByText('body-lg-medium')).toHaveClass('mm-text--body-lg-medium');
expect(getByText('body-md')).toHaveClass('mm-text--body-md');
+ expect(getByText('body-md-medium')).toHaveClass('mm-text--body-md-medium');
expect(getByText('body-md-bold')).toHaveClass('mm-text--body-md-bold');
expect(getByText('body-sm')).toHaveClass('mm-text--body-sm');
+ expect(getByText('body-sm-medium')).toHaveClass('mm-text--body-sm-medium');
expect(getByText('body-sm-bold')).toHaveClass('mm-text--body-sm-bold');
expect(getByText('body-xs')).toHaveClass('mm-text--body-xs');
+ expect(getByText('body-xs-medium')).toHaveClass('mm-text--body-xs-medium');
expect(container).toMatchSnapshot();
});
diff --git a/ui/components/component-library/text/text.types.ts b/ui/components/component-library/text/text.types.ts
index 295c4de2c..c83a41ce7 100644
--- a/ui/components/component-library/text/text.types.ts
+++ b/ui/components/component-library/text/text.types.ts
@@ -86,9 +86,12 @@ export interface TextProps extends BoxProps {
* `headingSm` large screen: 18px / small screen: 16px,
* `bodyLgMedium` large screen: 18px / small screen: 16px,
* `bodyMd` large screen: 16px / small screen: 14px,
+ * `bodyMdMedium` large screen: 16px / small screen: 14px,
* `bodyMdBold` large screen: 16px / small screen: 14px,
* `bodySm` large screen: 14px / small screen: 12px,
+ * `bodySmMedium` large screen: 14px / small screen: 12px,
* `bodySmBold` large screen: 14px / small screen: 12px,
+ * `bodyXsMedium` large screen: 12px / small screen: 10px,
* `bodyXs` large screen: 12px / small screen: 10px,
* `inherit`
*/
diff --git a/ui/helpers/constants/design-system.ts b/ui/helpers/constants/design-system.ts
index 18372b589..89530360a 100644
--- a/ui/helpers/constants/design-system.ts
+++ b/ui/helpers/constants/design-system.ts
@@ -187,10 +187,13 @@ export enum TextVariant {
headingSm = 'heading-sm',
bodyLgMedium = 'body-lg-medium',
bodyMd = 'body-md',
+ bodyMdMedium = 'body-md-medium',
bodyMdBold = 'body-md-bold',
bodySm = 'body-sm',
+ bodySmMedium = 'body-sm-medium',
bodySmBold = 'body-sm-bold',
bodyXs = 'body-xs',
+ bodyXsMedium = 'body-xs-medium',
inherit = 'inherit',
}
diff --git a/yarn.lock b/yarn.lock
index 6c7da3567..7111efda5 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -4024,10 +4024,10 @@ __metadata:
languageName: node
linkType: hard
-"@metamask/design-tokens@npm:^1.6.0, @metamask/design-tokens@npm:^1.9.0":
- version: 1.11.1
- resolution: "@metamask/design-tokens@npm:1.11.1"
- checksum: 38677f66167861826c35f7b0e6efc3c69269178e3dad5de41a9c9a7925dfb1f560f673e02a51acd7f7983762546130132f83dcaefe8ab47e16301775cff0b968
+"@metamask/design-tokens@npm:^1.12.0, @metamask/design-tokens@npm:^1.6.0":
+ version: 1.12.0
+ resolution: "@metamask/design-tokens@npm:1.12.0"
+ checksum: 9b6c5485c846171aa7fcef03cbe93b4d94ffaa76faf953aa27a689fd3d494438cd657de6ea1aa5a40cc2af15dcf10f8dd860fd3d90f5e9806807e37020bdccd9
languageName: node
linkType: hard
@@ -24489,7 +24489,7 @@ __metadata:
"@metamask/browser-passworder": ^4.1.0
"@metamask/contract-metadata": ^2.3.1
"@metamask/controller-utils": ^4.0.1
- "@metamask/design-tokens": ^1.9.0
+ "@metamask/design-tokens": ^1.12.0
"@metamask/desktop": ^0.3.0
"@metamask/eslint-config": ^9.0.0
"@metamask/eslint-config-jest": ^9.0.0
From 7c014896e80d26cfeb7d1767b064222f7c4a5e56 Mon Sep 17 00:00:00 2001
From: George Marshall
Date: Fri, 30 Jun 2023 14:11:29 -0700
Subject: [PATCH 003/351] Fix hold to reveal button on mobile browsers (#19847)
* Replacing MouseDown/Up events with PointerDown/Up so works on mobile browsers
* More test updates
* More test updates
---
.../hold-to-reveal-button/hold-to-reveal-button.js | 13 ++++++-------
.../hold-to-reveal-button.test.js | 2 +-
.../export-private-key-modal.component.test.js | 2 +-
.../hold-to-reveal-modal.test.js | 10 +++++-----
ui/pages/keychains/reveal-seed.test.js | 4 ++--
5 files changed, 15 insertions(+), 16 deletions(-)
diff --git a/ui/components/app/hold-to-reveal-button/hold-to-reveal-button.js b/ui/components/app/hold-to-reveal-button/hold-to-reveal-button.js
index 832e8a770..e48f3462b 100644
--- a/ui/components/app/hold-to-reveal-button/hold-to-reveal-button.js
+++ b/ui/components/app/hold-to-reveal-button/hold-to-reveal-button.js
@@ -2,11 +2,9 @@ import React, { useCallback, useContext, useRef, useState } from 'react';
import PropTypes from 'prop-types';
import classnames from 'classnames';
import { I18nContext } from '../../../contexts/i18n';
-import { Button } from '../../component-library';
-import Box from '../../ui/box';
import {
AlignItems,
- DISPLAY,
+ Display,
JustifyContent,
} from '../../../helpers/constants/design-system';
import { MetaMetricsContext } from '../../../contexts/metametrics';
@@ -15,6 +13,7 @@ import {
MetaMetricsEventKeyType,
MetaMetricsEventName,
} from '../../../../shared/constants/metametrics';
+import { Button, Box } from '../../component-library';
const radius = 14;
const strokeWidth = 2;
@@ -131,7 +130,7 @@ export default function HoldToRevealButton({ buttonText, onLongPressed }) {
{renderPreCompleteContent()}
diff --git a/ui/components/app/hold-to-reveal-button/hold-to-reveal-button.test.js b/ui/components/app/hold-to-reveal-button/hold-to-reveal-button.test.js
index 2fd23e8ef..2658b3cec 100644
--- a/ui/components/app/hold-to-reveal-button/hold-to-reveal-button.test.js
+++ b/ui/components/app/hold-to-reveal-button/hold-to-reveal-button.test.js
@@ -86,7 +86,7 @@ describe('HoldToRevealButton', () => {
const button = getByText('Hold to reveal SRP');
- fireEvent.mouseDown(button);
+ fireEvent.pointerDown(button);
const circleLocked = getByLabelText('hold to reveal circle locked');
fireEvent.transitionEnd(circleLocked);
diff --git a/ui/components/app/modals/export-private-key-modal/export-private-key-modal.component.test.js b/ui/components/app/modals/export-private-key-modal/export-private-key-modal.component.test.js
index f4a913280..c435d85ce 100644
--- a/ui/components/app/modals/export-private-key-modal/export-private-key-modal.component.test.js
+++ b/ui/components/app/modals/export-private-key-modal/export-private-key-modal.component.test.js
@@ -114,7 +114,7 @@ describe('Export Private Key Modal', () => {
const holdButton = getByText('Hold to reveal Private Key');
expect(holdButton).toBeInTheDocument();
- fireEvent.mouseDown(holdButton);
+ fireEvent.pointerDown(holdButton);
const circle = getByLabelText('hold to reveal circle locked');
fireEvent.transitionEnd(circle);
diff --git a/ui/components/app/modals/hold-to-reveal-modal/hold-to-reveal-modal.test.js b/ui/components/app/modals/hold-to-reveal-modal/hold-to-reveal-modal.test.js
index 52327246e..8a8ecc71a 100644
--- a/ui/components/app/modals/hold-to-reveal-modal/hold-to-reveal-modal.test.js
+++ b/ui/components/app/modals/hold-to-reveal-modal/hold-to-reveal-modal.test.js
@@ -67,7 +67,7 @@ describe('Hold to Reveal Modal', () => {
expect(holdButton).toBeDefined();
- fireEvent.mouseUp(holdButton);
+ fireEvent.pointerUp(holdButton);
expect(holdButton).toBeDefined();
});
@@ -84,7 +84,7 @@ describe('Hold to Reveal Modal', () => {
const holdButton = getByText('Hold to reveal SRP');
const circleLocked = queryByLabelText('hold to reveal circle locked');
- fireEvent.mouseDown(holdButton);
+ fireEvent.pointerDown(holdButton);
fireEvent.transitionEnd(circleLocked);
const circleUnlocked = queryByLabelText('hold to reveal circle unlocked');
@@ -92,7 +92,7 @@ describe('Hold to Reveal Modal', () => {
await waitFor(() => {
expect(holdButton.firstChild).toHaveClass(
- 'box hold-to-reveal-button__icon-container box--flex-direction-row',
+ 'hold-to-reveal-button__icon-container',
);
expect(onLongPressStub).toHaveBeenCalled();
});
@@ -164,7 +164,7 @@ describe('Hold to Reveal Modal', () => {
const holdButton = getByText('Hold to reveal SRP');
const circleLocked = queryByLabelText('hold to reveal circle locked');
- fireEvent.mouseDown(holdButton);
+ fireEvent.pointerDown(holdButton);
fireEvent.transitionEnd(circleLocked);
const circleUnlocked = queryByLabelText('hold to reveal circle unlocked');
@@ -172,7 +172,7 @@ describe('Hold to Reveal Modal', () => {
await waitFor(() => {
expect(holdButton.firstChild).toHaveClass(
- 'box hold-to-reveal-button__icon-container box--flex-direction-row',
+ 'hold-to-reveal-button__icon-container',
);
expect(onLongPressStub).toHaveBeenCalled();
expect(hideModalStub).not.toHaveBeenCalled();
diff --git a/ui/pages/keychains/reveal-seed.test.js b/ui/pages/keychains/reveal-seed.test.js
index 58baa7503..a028bef7b 100644
--- a/ui/pages/keychains/reveal-seed.test.js
+++ b/ui/pages/keychains/reveal-seed.test.js
@@ -216,7 +216,7 @@ describe('Reveal Seed Page', () => {
const holdButton = getByText('Hold to reveal SRP');
const circleLocked = queryByLabelText('hold to reveal circle locked');
- fireEvent.mouseDown(holdButton);
+ fireEvent.pointerDown(holdButton);
fireEvent.transitionEnd(circleLocked);
const circleUnlocked = queryByLabelText('hold to reveal circle unlocked');
@@ -224,7 +224,7 @@ describe('Reveal Seed Page', () => {
await waitFor(() => {
expect(holdButton.firstChild).toHaveClass(
- 'box hold-to-reveal-button__icon-container box--flex-direction-row',
+ 'hold-to-reveal-button__icon-container',
);
// tests that the mock srp is now shown.
expect(getByText('test srp')).toBeInTheDocument();
From 18699ccb0e48518a461a26a5fdf8629465a6988e Mon Sep 17 00:00:00 2001
From: Mark Stacey
Date: Fri, 30 Jun 2023 21:28:19 -0230
Subject: [PATCH 004/351] Add metamaskbot comment when policy update fails
(#19772)
The `metamaskbot` account now comments with a failure message when the
policy update fails. This comment also includes a link to the specific
run that failed, so that the PR author can review the log and/or retry
the policy update.
---
.../workflows/update-lavamoat-policies.yml | 34 +++++++++++++++++++
1 file changed, 34 insertions(+)
diff --git a/.github/workflows/update-lavamoat-policies.yml b/.github/workflows/update-lavamoat-policies.yml
index 5f2814e97..b05221889 100644
--- a/.github/workflows/update-lavamoat-policies.yml
+++ b/.github/workflows/update-lavamoat-policies.yml
@@ -223,3 +223,37 @@ jobs:
HAS_CHANGES: ${{ steps.policy-changes.outputs.HAS_CHANGES }}
GITHUB_TOKEN: ${{ secrets.LAVAMOAT_UPDATE_TOKEN }}
PR_NUMBER: ${{ github.event.issue.number }}
+
+ check-status:
+ name: Check whether the policy update succeeded
+ runs-on: ubuntu-latest
+ needs:
+ - commit-updated-policies
+ outputs:
+ PASSED: ${{ steps.set-output.outputs.PASSED }}
+ steps:
+ - name: Set PASSED output
+ id: set-output
+ run: echo "PASSED=true" >> "$GITHUB_OUTPUT"
+
+ failure-comment:
+ name: Comment about the policy update failure
+ if: ${{ always() && needs.is-fork-pull-request.outputs.IS_FORK == 'false' }}
+ runs-on: ubuntu-latest
+ needs:
+ - is-fork-pull-request
+ - check-status
+ steps:
+ - uses: actions/checkout@v3
+ with:
+ token: ${{ secrets.LAVAMOAT_UPDATE_TOKEN }}
+ - name: Post comment if the update failed
+ run: |
+ passed="${{ needs.check-status.outputs.PASSED }}"
+ if [[ $passed != "true" ]]; then
+ gh pr comment "${PR_NUMBER}" --body "Policy update failed. You can [review the logs or retry the policy update here](${ACTION_RUN_URL})"
+ fi
+ env:
+ GITHUB_TOKEN: ${{ secrets.LAVAMOAT_UPDATE_TOKEN }}
+ PR_NUMBER: ${{ github.event.issue.number }}
+ ACTION_RUN_URL: "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
From e05aec850214c5a966bdd74291f0d16fc5726623 Mon Sep 17 00:00:00 2001
From: David Walsh
Date: Tue, 4 Jul 2023 07:00:09 -0500
Subject: [PATCH 005/351] Fix #19830 - UX: Multichain test linting (#19792)
* Fix address-copy-button.test.js
* Fix connected-site-menu.js
* Fix app-header.test.js
* Fix product-tour-popover.test.js
---
test/jest/setup.js | 3 +++
.../multichain/app-header/app-header.test.js | 2 +-
.../__snapshots__/connected-site-menu.test.js.snap | 12 ++++++------
.../connected-site-menu/connected-site-menu.js | 3 +--
.../product-tour-popover.test.js | 1 +
5 files changed, 12 insertions(+), 9 deletions(-)
diff --git a/test/jest/setup.js b/test/jest/setup.js
index a3c5d2568..94feffdff 100644
--- a/test/jest/setup.js
+++ b/test/jest/setup.js
@@ -127,3 +127,6 @@ expect.extend({
};
},
});
+
+// Setup window.prompt
+global.prompt = () => undefined;
diff --git a/ui/components/multichain/app-header/app-header.test.js b/ui/components/multichain/app-header/app-header.test.js
index 555c6b368..be47b4320 100644
--- a/ui/components/multichain/app-header/app-header.test.js
+++ b/ui/components/multichain/app-header/app-header.test.js
@@ -5,7 +5,7 @@ import mockState from '../../../../test/data/mock-state.json';
import { SEND_STAGES } from '../../../ducks/send';
import { AppHeader } from '.';
-const render = (stateChanges = {}, location = jest.fn()) => {
+const render = (stateChanges = {}, location = {}) => {
const store = configureStore({
...mockState,
activeTab: {
diff --git a/ui/components/multichain/connected-site-menu/__snapshots__/connected-site-menu.test.js.snap b/ui/components/multichain/connected-site-menu/__snapshots__/connected-site-menu.test.js.snap
index 68431a73b..6bc7bff45 100644
--- a/ui/components/multichain/connected-site-menu/__snapshots__/connected-site-menu.test.js.snap
+++ b/ui/components/multichain/connected-site-menu/__snapshots__/connected-site-menu.test.js.snap
@@ -3,7 +3,7 @@
exports[`Connected Site Menu should render the site menu in connected state 1`] = `
@@ -40,7 +40,7 @@ exports[`Connected Site Menu should render the site menu in connected state 1`]
exports[`Connected Site Menu should render the site menu in not connected state 1`] = `
@@ -77,7 +77,7 @@ exports[`Connected Site Menu should render the site menu in not connected state
exports[`Connected Site Menu should render the site menu in not connected to current account state 1`] = `