Skip to content

Commit daadd0c

Browse files
committed
test empty indentities
1 parent ddb5d3d commit daadd0c

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

app/store/migrations/037.test.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,28 @@ describe('Migration #037', () => {
235235
},
236236
});
237237
});
238+
239+
it('should handle empty identities and create default AccountsController with no internal accounts', async () => {
240+
const oldState = createMockState({
241+
// Simulate `identities` being an empty object
242+
identities: {},
243+
});
244+
const newState = await migrate(oldState);
245+
246+
expect(newState).toStrictEqual({
247+
engine: {
248+
backgroundState: {
249+
PreferencesController: expect.any(Object),
250+
AccountsController: {
251+
internalAccounts: {
252+
accounts: {}, // Expect no accounts to be created
253+
selectedAccount: '', // Expect no account to be selected
254+
},
255+
},
256+
},
257+
},
258+
});
259+
});
238260
});
239261

240262
describe('createSelectedAccountForAccountsController', () => {

0 commit comments

Comments
 (0)