Skip to content

Commit

Permalink
updating test
Browse files Browse the repository at this point in the history
  • Loading branch information
NiranjanaBinoy committed Dec 13, 2022
1 parent 68cb669 commit 3e22bbb
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion packages/assets-controllers/src/TokensController.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -756,14 +756,14 @@ describe('TokensController', () => {
[DETECTED_CHAINID]: {
[DETECTED_ADDRESS]: [detectedToken],
},
'4': { '0xabc': [] },
});

expect(tokensController.state.allTokens).toStrictEqual({
[NetworksChainId[CONFIGURED_NETWORK]]: {
[CONFIGURED_ADDRESS]: [directlyAddedToken],
},
});

stub.restore();
});
});
Expand Down Expand Up @@ -852,6 +852,21 @@ describe('TokensController', () => {
).toStrictEqual(dummyTokens);
});

it('should nest detectedTokens under chain ID and selected address when detectedTokens provided is an empty list', () => {
tokensController.configure({
selectedAddress: dummySelectedAddress,
chainId: NetworksChainId.mainnet,
});
const processedTokens = tokensController._getNewAllTokensState({
newDetectedTokens: [],
});
expect(
processedTokens.newAllDetectedTokens[NetworksChainId.mainnet][
dummySelectedAddress
],
).toStrictEqual([]);
});

it('should nest ignoredTokens under chain ID and selected address when provided with ignoredTokens as input', () => {
tokensController.configure({
selectedAddress: dummySelectedAddress,
Expand Down

0 comments on commit 3e22bbb

Please sign in to comment.