Skip to content
Merged
Prev Previous commit
Next Next commit
fix: move mockState closer to publish
  • Loading branch information
montelaidev committed Jul 3, 2024
commit a3fbf300ae8d788917de2fcacd4c0f3e1850c3b3
20 changes: 10 additions & 10 deletions packages/accounts-controller/src/AccountsController.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -451,16 +451,6 @@ describe('AccountsController', () => {
.mockReturnValueOnce('mock-id') // call to check if its a new account
.mockReturnValueOnce('mock-id2'); // call to add account

const mockNewKeyringState = {
isUnlocked: true,
keyrings: [
{
type: KeyringTypes.hd,
accounts: [mockAccount.address],
},
],
};

const { accountsController } = setupAccountsController({
initialState: {
internalAccounts: {
Expand All @@ -476,6 +466,16 @@ describe('AccountsController', () => {
'listMultichainAccounts',
);

const mockNewKeyringState = {
isUnlocked: true,
keyrings: [
{
type: KeyringTypes.hd,
accounts: [mockAccount.address],
},
],
};

messenger.publish(
'KeyringController:stateChange',
mockNewKeyringState,
Expand Down