File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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' , ( ) => {
You can’t perform that action at this time.
0 commit comments