@@ -388,7 +388,7 @@ describe('user-storage/user-storage-controller - enableProfileSyncing() tests',
388388} ) ;
389389
390390describe ( 'user-storage/user-storage-controller - syncInternalAccountsWithUserStorage() tests' , ( ) => {
391- it ( 'rejects if UserStorage is not enabled' , async ( ) => {
391+ it ( 'returns void if UserStorage is not enabled' , async ( ) => {
392392 const arrangeMocks = async ( ) => {
393393 return {
394394 messengerMocks : mockUserStorageMessenger ( ) ,
@@ -409,9 +409,9 @@ describe('user-storage/user-storage-controller - syncInternalAccountsWithUserSto
409409 } ,
410410 } ) ;
411411
412- await expect (
413- controller . syncInternalAccountsWithUserStorage ( ) ,
414- ) . rejects . toThrow ( expect . any ( Error ) ) ;
412+ await controller . syncInternalAccountsWithUserStorage ( ) ;
413+
414+ expect ( messengerMocks . mockAccountsListAccounts ) . not . toHaveBeenCalled ( ) ;
415415 } ) ;
416416
417417 it ( 'returns void if account syncing feature flag is disabled' , async ( ) => {
@@ -1083,7 +1083,7 @@ describe('user-storage/user-storage-controller - syncInternalAccountsWithUserSto
10831083} ) ;
10841084
10851085describe ( 'user-storage/user-storage-controller - saveInternalAccountToUserStorage() tests' , ( ) => {
1086- it ( 'rejects if UserStorage is not enabled' , async ( ) => {
1086+ it ( 'returns void if UserStorage is not enabled' , async ( ) => {
10871087 const arrangeMocks = async ( ) => {
10881088 return {
10891089 messengerMocks : mockUserStorageMessenger ( ) ,
@@ -1103,11 +1103,13 @@ describe('user-storage/user-storage-controller - saveInternalAccountToUserStorag
11031103 } ,
11041104 } ) ;
11051105
1106- await expect (
1107- controller . saveInternalAccountToUserStorage (
1108- MOCK_INTERNAL_ACCOUNTS . ONE [ 0 ] . address ,
1109- ) ,
1110- ) . rejects . toThrow ( expect . any ( Error ) ) ;
1106+ await controller . saveInternalAccountToUserStorage (
1107+ MOCK_INTERNAL_ACCOUNTS . ONE [ 0 ] as InternalAccount ,
1108+ ) ;
1109+
1110+ expect (
1111+ messengerMocks . mockAccountsGetAccountByAddress ,
1112+ ) . not . toHaveBeenCalled ( ) ;
11111113 } ) ;
11121114
11131115 it ( 'returns void if account syncing feature flag is disabled' , async ( ) => {
@@ -1130,7 +1132,7 @@ describe('user-storage/user-storage-controller - saveInternalAccountToUserStorag
11301132 } ) ;
11311133
11321134 await controller . saveInternalAccountToUserStorage (
1133- MOCK_INTERNAL_ACCOUNTS . ONE [ 0 ] . address ,
1135+ MOCK_INTERNAL_ACCOUNTS . ONE [ 0 ] as InternalAccount ,
11341136 ) ;
11351137
11361138 expect ( mockAPI . isDone ( ) ) . toBe ( false ) ;
@@ -1156,7 +1158,7 @@ describe('user-storage/user-storage-controller - saveInternalAccountToUserStorag
11561158 } ) ;
11571159
11581160 await controller . saveInternalAccountToUserStorage (
1159- MOCK_INTERNAL_ACCOUNTS . ONE [ 0 ] . address ,
1161+ MOCK_INTERNAL_ACCOUNTS . ONE [ 0 ] as InternalAccount ,
11601162 ) ;
11611163
11621164 expect ( mockAPI . isDone ( ) ) . toBe ( true ) ;
@@ -1184,7 +1186,7 @@ describe('user-storage/user-storage-controller - saveInternalAccountToUserStorag
11841186
11851187 await expect (
11861188 controller . saveInternalAccountToUserStorage (
1187- MOCK_INTERNAL_ACCOUNTS . ONE [ 0 ] . address ,
1189+ MOCK_INTERNAL_ACCOUNTS . ONE [ 0 ] as InternalAccount ,
11881190 ) ,
11891191 ) . rejects . toThrow ( expect . any ( Error ) ) ;
11901192 } ) ;
@@ -1210,7 +1212,7 @@ describe('user-storage/user-storage-controller - saveInternalAccountToUserStorag
12101212 ) ;
12111213
12121214 expect ( mockSaveInternalAccountToUserStorage ) . toHaveBeenCalledWith (
1213- MOCK_INTERNAL_ACCOUNTS . ONE [ 0 ] . address ,
1215+ MOCK_INTERNAL_ACCOUNTS . ONE [ 0 ] ,
12141216 ) ;
12151217 } ) ;
12161218
@@ -1235,7 +1237,7 @@ describe('user-storage/user-storage-controller - saveInternalAccountToUserStorag
12351237 ) ;
12361238
12371239 expect ( mockSaveInternalAccountToUserStorage ) . toHaveBeenCalledWith (
1238- MOCK_INTERNAL_ACCOUNTS . ONE [ 0 ] . address ,
1240+ MOCK_INTERNAL_ACCOUNTS . ONE [ 0 ] ,
12391241 ) ;
12401242 } ) ;
12411243} ) ;
@@ -1272,7 +1274,6 @@ function mockUserStorageMessenger(options?: {
12721274 'NotificationServicesController:selectIsNotificationServicesEnabled' ,
12731275 'AccountsController:listAccounts' ,
12741276 'AccountsController:updateAccountMetadata' ,
1275- 'AccountsController:getAccountByAddress' ,
12761277 'KeyringController:addNewAccount' ,
12771278 ] ,
12781279 allowedEvents : [
0 commit comments