Skip to content

Commit 6867941

Browse files
committed
fix multichain-account-service tests
1 parent 80fba50 commit 6867941

1 file changed

Lines changed: 10 additions & 9 deletions

File tree

packages/multichain-account-service/src/MultichainAccountService.test.ts

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -847,13 +847,14 @@ describe('MultichainAccountService', () => {
847847
});
848848

849849
it('resync accounts with MultichainAccountService:resyncAccounts', async () => {
850-
const { messenger, service } = await setup({
850+
const { messenger, mocks } = await setup({
851851
accounts: [MOCK_HD_ACCOUNT_1],
852852
});
853853

854-
const resyncAccountsSpy = jest.spyOn(service, 'resyncAccounts');
855854
await messenger.call('MultichainAccountService:resyncAccounts');
856-
expect(resyncAccountsSpy).toHaveBeenCalled();
855+
856+
expect(mocks.EvmAccountProvider.resyncAccounts).toHaveBeenCalled();
857+
expect(mocks.SolAccountProvider.resyncAccounts).toHaveBeenCalled();
857858
});
858859

859860
it('removes a multichain account wallet with MultichainAccountService:removeMultichainAccountWallet', async () => {
@@ -873,18 +874,18 @@ describe('MultichainAccountService', () => {
873874
});
874875

875876
it('checks for Snap platform readiness with MultichainAccountService:ensureCanUseSnapPlatform', async () => {
876-
const { messenger, service } = await setup({
877+
const { rootMessenger, service, spies } = await setup({
877878
accounts: [],
878879
});
879880

880881
await service.ensureCanUseSnapPlatform();
881882

882-
const ensureCanUseSnapPlatformSpy = jest.spyOn(
883-
service,
884-
'ensureCanUseSnapPlatform',
883+
await rootMessenger.call(
884+
'MultichainAccountService:ensureCanUseSnapPlatform',
885885
);
886-
await messenger.call('MultichainAccountService:ensureCanUseSnapPlatform');
887-
expect(ensureCanUseSnapPlatformSpy).toHaveBeenCalled();
886+
expect(
887+
spies.SnapPlatformWatcher.ensureCanUseSnapPlatform,
888+
).toHaveBeenCalled();
888889
});
889890
});
890891

0 commit comments

Comments
 (0)