Skip to content

Commit

Permalink
test: add new test to check filter
Browse files Browse the repository at this point in the history
  • Loading branch information
montelaidev committed Jun 14, 2024
1 parent 8da04d4 commit 2bb3a2a
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions app/scripts/metamask-controller.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1391,6 +1391,33 @@ describe('MetaMaskController', () => {
]);
expect(metamaskController.getState()).toStrictEqual(oldState);
});

it('should filter out non-EVM addresses prior to calling syncWithAddresses', async () => {
jest
.spyOn(metamaskController.accountTracker, 'syncWithAddresses')
.mockReturnValue();

const oldState = metamaskController.getState();
await metamaskController._onKeyringControllerUpdate({
keyrings: [
{
accounts: [
'0x603E83442BA54A2d0E080c34D6908ec228bef59f',
'0xDe95cE6E727692286E02A931d074efD1E5E2f03c',
'1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa',
],
},
],
});

expect(
metamaskController.accountTracker.syncWithAddresses,
).toHaveBeenCalledWith([
'0x603E83442BA54A2d0E080c34D6908ec228bef59f',
'0xDe95cE6E727692286E02A931d074efD1E5E2f03c',
]);
expect(metamaskController.getState()).toStrictEqual(oldState);
});
});

describe('markNotificationsAsRead', () => {
Expand Down

0 comments on commit 2bb3a2a

Please sign in to comment.