Skip to content

Commit

Permalink
test empty indentities
Browse files Browse the repository at this point in the history
  • Loading branch information
owencraston committed Mar 21, 2024
1 parent ddb5d3d commit daadd0c
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions app/store/migrations/037.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,28 @@ describe('Migration #037', () => {
},
});
});

it('should handle empty identities and create default AccountsController with no internal accounts', async () => {
const oldState = createMockState({
// Simulate `identities` being an empty object
identities: {},
});
const newState = await migrate(oldState);

expect(newState).toStrictEqual({
engine: {
backgroundState: {
PreferencesController: expect.any(Object),
AccountsController: {
internalAccounts: {
accounts: {}, // Expect no accounts to be created
selectedAccount: '', // Expect no account to be selected
},
},
},
},
});
});
});

describe('createSelectedAccountForAccountsController', () => {
Expand Down

0 comments on commit daadd0c

Please sign in to comment.