From eb4bc370082e605f8e822b257f294bc515ce454c Mon Sep 17 00:00:00 2001 From: Prithpal Sooriya Date: Fri, 13 Sep 2024 17:31:02 +0100 Subject: [PATCH] test: remove unused test --- .../UserStorageController.test.ts | 48 ++----------------- 1 file changed, 3 insertions(+), 45 deletions(-) diff --git a/packages/profile-sync-controller/src/controllers/user-storage/UserStorageController.test.ts b/packages/profile-sync-controller/src/controllers/user-storage/UserStorageController.test.ts index 164ab168b43..c92f884ea0a 100644 --- a/packages/profile-sync-controller/src/controllers/user-storage/UserStorageController.test.ts +++ b/packages/profile-sync-controller/src/controllers/user-storage/UserStorageController.test.ts @@ -1083,35 +1083,6 @@ describe('user-storage/user-storage-controller - syncInternalAccountsWithUserSto }); describe('user-storage/user-storage-controller - saveInternalAccountToUserStorage() tests', () => { - it('returns void if UserStorage is not enabled', async () => { - const arrangeMocks = async () => { - return { - messengerMocks: mockUserStorageMessenger(), - }; - }; - - const { messengerMocks } = await arrangeMocks(); - const controller = new UserStorageController({ - messenger: messengerMocks.messenger, - env: { - isAccountSyncingEnabled: true, - }, - getMetaMetricsState: () => true, - state: { - isProfileSyncingEnabled: false, - isProfileSyncingUpdateLoading: false, - }, - }); - - await controller.saveInternalAccountToUserStorage( - MOCK_INTERNAL_ACCOUNTS.ONE[0] as InternalAccount, - ); - - expect( - messengerMocks.mockAccountsGetAccountByAddress, - ).not.toHaveBeenCalled(); - }); - it('returns void if account syncing feature flag is disabled', async () => { const arrangeMocks = async () => { return { @@ -1336,10 +1307,6 @@ function mockUserStorageMessenger(options?: { const mockAccountsUpdateAccountMetadata = jest.fn().mockResolvedValue(true); - const mockAccountsGetAccountByAddress = jest - .fn() - .mockResolvedValue(MOCK_INTERNAL_ACCOUNTS.ONE[0]); - jest.spyOn(messenger, 'call').mockImplementation((...args) => { // Creates the correct typed call params for mocks type CallParams = { @@ -1417,17 +1384,9 @@ function mockUserStorageMessenger(options?: { return mockAccountsUpdateAccountMetadata(args.slice(1)); } - if (actionType === 'AccountsController:getAccountByAddress') { - return mockAccountsGetAccountByAddress(); - } - - const exhaustedMessengerMocks = (action: never) => { - throw new Error( - `MOCK_FAIL - unsupported messenger call: ${action as string}`, - ); - }; - - return exhaustedMessengerMocks(actionType); + throw new Error( + `MOCK_FAIL - unsupported messenger call: ${actionType as string}`, + ); }); return { @@ -1444,7 +1403,6 @@ function mockUserStorageMessenger(options?: { mockAuthPerformSignOut, mockKeyringAddNewAccount, mockAccountsUpdateAccountMetadata, - mockAccountsGetAccountByAddress, mockAccountsListAccounts, }; }