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 5d43932
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 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 @@ -266,10 +266,9 @@ describe('MetaMaskController', function () {
decimals,
networkClientId: 'networkClientId1',
});
assert.strictEqual(
metamaskController.tokensController.getNetworkClientById.getCall(0)
.args[0],
'networkClientId1',
assert.deepStrictEqual(
metamaskController.controllerMessenger.call.getCall(0).args,
['NetworkController:getNetworkClientById', 'networkClientId1'],
);
});
});
Expand Down

0 comments on commit 5d43932

Please sign in to comment.