Skip to content

Commit

Permalink
test: Fix incorrect mock for KeyringController:getState
Browse files Browse the repository at this point in the history
  • Loading branch information
MajorLift committed Feb 6, 2024
1 parent 5df6b81 commit 3fd2138
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
convertHexToDecimal,
BUILT_IN_NETWORKS,
} from '@metamask/controller-utils';
import type { KeyringControllerState } from '@metamask/keyring-controller';
import {
defaultState as defaultNetworkState,
type NetworkConfiguration,
Expand Down Expand Up @@ -1303,9 +1304,9 @@ async function withController<ReturnValue>(
});
controllerMessenger.registerActionHandler(
'KeyringController:getState',
jest.fn().mockReturnValue({
isActive: true,
}),
jest.fn<KeyringControllerState, []>().mockReturnValue({
isUnlocked: true,
} as unknown as KeyringControllerState),
);
controllerMessenger.registerActionHandler(
'NetworkController:getNetworkConfigurationByNetworkClientId',
Expand Down

0 comments on commit 3fd2138

Please sign in to comment.