Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Mrtenz committed Nov 23, 2022
1 parent 683aad7 commit b285e63
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ describe('MultiChainController', () => {
},
},
});
expect(rootMessenger.call).toHaveBeenCalledTimes(11);
expect(rootMessenger.call).toHaveBeenCalledTimes(12);

snapController.destroy();
await executionService.terminateAllSnaps();
Expand Down Expand Up @@ -99,7 +99,7 @@ describe('MultiChainController', () => {
MOCK_SNAP_ID,
);

expect(rootMessenger.call).toHaveBeenCalledTimes(21);
expect(rootMessenger.call).toHaveBeenCalledTimes(23);

snapController.destroy();
await executionService.terminateAllSnaps();
Expand Down Expand Up @@ -153,7 +153,7 @@ describe('MultiChainController', () => {
},
});

expect(rootMessenger.call).toHaveBeenCalledTimes(9);
expect(rootMessenger.call).toHaveBeenCalledTimes(10);

snapController.destroy();
await executionService.terminateAllSnaps();
Expand Down Expand Up @@ -255,9 +255,9 @@ describe('MultiChainController', () => {
},
});

expect(rootMessenger.call).toHaveBeenCalledTimes(17);
expect(rootMessenger.call).toHaveBeenCalledTimes(19);
expect(rootMessenger.call).toHaveBeenNthCalledWith(
15,
17,
'ApprovalController:addRequest',
{
id: expect.any(String),
Expand Down Expand Up @@ -326,7 +326,7 @@ describe('MultiChainController', () => {
).rejects.toThrow(
'No installed snaps found for any requested namespace.',
);
expect(rootMessenger.call).toHaveBeenCalledTimes(9);
expect(rootMessenger.call).toHaveBeenCalledTimes(10);

snapController.destroy();
await executionService.terminateAllSnaps();
Expand Down Expand Up @@ -359,7 +359,7 @@ describe('MultiChainController', () => {
});

expect(result).toEqual(['eip155:1:foo']);
expect(rootMessenger.call).toHaveBeenCalledTimes(15);
expect(rootMessenger.call).toHaveBeenCalledTimes(17);

snapController.destroy();
await executionService.terminateAllSnaps();
Expand Down
10 changes: 2 additions & 8 deletions packages/snaps-controllers/src/snaps/SnapController.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1325,13 +1325,7 @@ describe('SnapController', () => {
const options = getSnapControllerWithEESOptions({
rootMessenger,
state: {
snaps: {
[MOCK_SNAP_ID]: {
enabled: true,
id: MOCK_SNAP_ID,
status: SnapStatus.Running,
} as any,
},
snaps: getPersistedSnapsState(),
},
});
const [snapController, service] = getSnapControllerWithEES(options);
Expand All @@ -1355,7 +1349,7 @@ describe('SnapController', () => {
},
});

expect(rootMessenger.call).toHaveBeenCalledTimes(3);
expect(rootMessenger.call).toHaveBeenCalledTimes(7);
expect(rootMessenger.call).toHaveBeenCalledWith(
'ExecutionService:handleRpcRequest',
MOCK_SNAP_ID,
Expand Down

0 comments on commit b285e63

Please sign in to comment.