From 32691fdf35523df50a1b9108e2aa634137e56c71 Mon Sep 17 00:00:00 2001 From: Nicholas Gambino Date: Tue, 27 Aug 2024 14:21:06 -0700 Subject: [PATCH] Update unit tests --- app/scripts/migrations/index.js | 1 + shared/constants/swaps.ts | 4 ++-- ui/components/app/add-network/add-network.js | 2 ++ .../__snapshots__/network-list-item.test.js.snap | 6 +----- ui/components/ui/token-input/token-input.component.test.js | 4 ++-- .../components/simulation-details/asset-pill.test.tsx | 4 ++-- 6 files changed, 10 insertions(+), 11 deletions(-) diff --git a/app/scripts/migrations/index.js b/app/scripts/migrations/index.js index cab35bd3fcf7..f3ee81dcdcd8 100644 --- a/app/scripts/migrations/index.js +++ b/app/scripts/migrations/index.js @@ -144,6 +144,7 @@ const migrations = [ require('./125'), require('./126'), require('./127'), + require('./128'), ]; export default migrations; diff --git a/shared/constants/swaps.ts b/shared/constants/swaps.ts index bd3db9d94a2f..53e1243acaa0 100644 --- a/shared/constants/swaps.ts +++ b/shared/constants/swaps.ts @@ -2,7 +2,7 @@ import { ETH_TOKEN_IMAGE_URL, TEST_ETH_TOKEN_IMAGE_URL, BNB_TOKEN_IMAGE_URL, - MATIC_TOKEN_IMAGE_URL, + POL_TOKEN_IMAGE_URL, AVAX_TOKEN_IMAGE_URL, CURRENCY_SYMBOLS, CHAIN_IDS, @@ -74,7 +74,7 @@ export const MATIC_SWAPS_TOKEN_OBJECT: SwapsTokenObject = { name: 'Matic', address: DEFAULT_TOKEN_ADDRESS, decimals: 18, - iconUrl: MATIC_TOKEN_IMAGE_URL, + iconUrl: POL_TOKEN_IMAGE_URL, } as const; export const AVAX_SWAPS_TOKEN_OBJECT: SwapsTokenObject = { diff --git a/ui/components/app/add-network/add-network.js b/ui/components/app/add-network/add-network.js index a8a2bd5dc7bf..fe8176784f47 100644 --- a/ui/components/app/add-network/add-network.js +++ b/ui/components/app/add-network/add-network.js @@ -50,6 +50,8 @@ const AddNetwork = () => { const history = useHistory(); const networkConfigurations = useSelector(getNetworkConfigurations); + console.log('networkConfigurations', networkConfigurations); + const networkConfigurationChainIds = Object.values(networkConfigurations).map( (net) => net.chainId, ); diff --git a/ui/components/multichain/network-list-item/__snapshots__/network-list-item.test.js.snap b/ui/components/multichain/network-list-item/__snapshots__/network-list-item.test.js.snap index ede77cf934c3..4cc69f7105d0 100644 --- a/ui/components/multichain/network-list-item/__snapshots__/network-list-item.test.js.snap +++ b/ui/components/multichain/network-list-item/__snapshots__/network-list-item.test.js.snap @@ -8,11 +8,7 @@ exports[`NetworkListItem renders properly 1`] = `
- Polygon logo + P
{ metamask: { ...mockState.metamask, currencyRates: { - [CURRENCY_SYMBOLS.MATIC]: { + [CURRENCY_SYMBOLS.POL]: { conversionRate: 1, }, }, @@ -84,7 +84,7 @@ describe('TokenInput Component', () => { mockStore, ); - expect(queryByTitle('0 MATIC')).toBeInTheDocument(); + expect(queryByTitle('0 POL')).toBeInTheDocument(); }); it('should render showFiat', () => { diff --git a/ui/pages/confirmations/components/simulation-details/asset-pill.test.tsx b/ui/pages/confirmations/components/simulation-details/asset-pill.test.tsx index 0b83b08fb784..77d49ac6c561 100644 --- a/ui/pages/confirmations/components/simulation-details/asset-pill.test.tsx +++ b/ui/pages/confirmations/components/simulation-details/asset-pill.test.tsx @@ -38,8 +38,8 @@ describe('AssetPill', () => { { chainId: CHAIN_IDS.POLYGON, expected: { - ticker: 'MATIC', - imgSrc: './images/matic-token.svg', + ticker: 'POL', + imgSrc: './images/pol-token.svg', }, }, ];