From 786a74dbbc35bb77b972bc7e960702aa16a0e5a2 Mon Sep 17 00:00:00 2001 From: Thomas Huang Date: Tue, 7 Mar 2023 06:46:02 -0800 Subject: [PATCH] Fix nft test state (#17981) --- test/data/mock-state.json | 80 +++++++++++++++++++ .../__snapshots__/nft-details.test.js.snap | 2 +- .../app/nft-details/nft-details.test.js | 2 +- .../app/nfts-items/nfts-items.test.js | 2 +- 4 files changed, 83 insertions(+), 3 deletions(-) diff --git a/test/data/mock-state.json b/test/data/mock-state.json index 0e391d1c7..323f124ae 100644 --- a/test/data/mock-state.json +++ b/test/data/mock-state.json @@ -269,6 +269,86 @@ } }, "allNftContracts": { + "0x0dcd5d886577d5081b0c52e242ef29e70be3e7bc": { + "1": [ + { + "address": "0xDc7382Eb0Bc9C352A4CbA23c909bDA01e0206414", + "description": null, + "name": "Munk Generator", + "logo": null, + "symbol": "MUNK", + "assetContractType": "non-fungible", + "createdDate": null, + "schemaName": "ERC721", + "externalLink": null + } + ], + "137": [ + { + "address": "0xDc7382Eb0Bc9C352A4CbA23c909bDA01e0206414", + "description": null, + "name": "Munk Generator", + "logo": null, + "symbol": "MUNK", + "assetContractType": "non-fungible", + "createdDate": null, + "schemaName": "ERC721", + "externalLink": null + } + ], + "11155111": [ + { + "address": "0xDc7382Eb0Bc9C352A4CbA23c909bDA01e0206414", + "description": null, + "name": "Munk Generator", + "logo": null, + "symbol": "MUNK", + "assetContractType": "non-fungible", + "createdDate": null, + "schemaName": "ERC721", + "externalLink": null + } + ], + "5": [ + { + "address": "0xDc7382Eb0Bc9C352A4CbA23c909bDA01e0206414", + "description": null, + "name": "Munk Generator", + "logo": null, + "symbol": "MUNK", + "assetContractType": "non-fungible", + "createdDate": null, + "schemaName": "ERC721", + "externalLink": null + }, + { + "address": "0x495f947276749Ce646f68AC8c248420045cb7b5e", + "description": null, + "name": "Punk Generator", + "logo": null, + "symbol": "PUNK", + "assetContractType": "non-fungible", + "createdDate": null, + "schemaName": "ERC1155", + "externalLink": null + } + ], + "153": [ + { + "address": "0xDc7382Eb0Bc9C352A4CbA23c909bDA01e0206414", + "description": null, + "name": "Munk Generator", + "logo": null, + "symbol": "MUNK", + "assetContractType": "non-fungible", + "createdDate": null, + "schemaName": "ERC721", + "externalLink": null + } + ] + } + }, + "allNfts": { "0x0dcd5d886577d5081b0c52e242ef29e70be3e7bc": { "1": [ { diff --git a/ui/components/app/nft-details/__snapshots__/nft-details.test.js.snap b/ui/components/app/nft-details/__snapshots__/nft-details.test.js.snap index 4e0107faf..5b551c137 100644 --- a/ui/components/app/nft-details/__snapshots__/nft-details.test.js.snap +++ b/ui/components/app/nft-details/__snapshots__/nft-details.test.js.snap @@ -20,7 +20,7 @@ exports[`NFT Details should match minimal props and state snapshot 1`] = ` - MUNK #1 + Munk Generator
diff --git a/ui/components/app/nft-details/nft-details.test.js b/ui/components/app/nft-details/nft-details.test.js index 07c192207..57e99f25a 100644 --- a/ui/components/app/nft-details/nft-details.test.js +++ b/ui/components/app/nft-details/nft-details.test.js @@ -43,7 +43,7 @@ describe('NFT Details', () => { const mockStore = configureMockStore([thunk])(mockState); const nfts = - mockState.metamask.allNftContracts[mockState.metamask.selectedAddress][5]; + mockState.metamask.allNfts[mockState.metamask.selectedAddress][5]; const props = { nft: nfts[5], diff --git a/ui/components/app/nfts-items/nfts-items.test.js b/ui/components/app/nfts-items/nfts-items.test.js index a36dfccca..3cb67d2e1 100644 --- a/ui/components/app/nfts-items/nfts-items.test.js +++ b/ui/components/app/nfts-items/nfts-items.test.js @@ -24,7 +24,7 @@ jest.mock('../../../store/actions.ts', () => ({ describe('NFTs Item Component', () => { const nfts = - mockState.metamask.allNftContracts[mockState.metamask.selectedAddress][5]; + mockState.metamask.allNfts[mockState.metamask.selectedAddress][5]; const props = { collections: { '0x0dcd5d886577d5081b0c52e242ef29e70be3e7bc': {