Skip to content

Commit

Permalink
test: Fix unit test to use messenger pattern for `getNetworkClientByI…
Browse files Browse the repository at this point in the history
…d` action
  • Loading branch information
MajorLift committed Mar 9, 2024
1 parent b1d99d8 commit c6a3a05
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions app/scripts/metamask-controller.actions.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ describe('MetaMaskController', function () {
Promise.resolve({ supportsInterface: supportsInterfaceStub }),
);
sinon
.stub(metamaskController.tokensController, 'getNetworkClientById')
.stub(metamaskController.controllerMessenger, 'call')
.callsFake(() => ({
configuration: {
chainId: '0xa',
Expand All @@ -267,8 +267,11 @@ describe('MetaMaskController', function () {
networkClientId: 'networkClientId1',
});
assert.strictEqual(
metamaskController.tokensController.getNetworkClientById.getCall(0)
.args[0],
metamaskController.controllerMessenger.call.getCall(0).args[0],
'NetworkController:getNetworkClientById',
);
assert.strictEqual(
metamaskController.controllerMessenger.call.getCall(0).args[1],
'networkClientId1',
);
});
Expand Down

0 comments on commit c6a3a05

Please sign in to comment.