From 0c4315f2e5088be2a3d708f6d100fc52a448d7c5 Mon Sep 17 00:00:00 2001 From: iamacook Date: Tue, 26 Sep 2023 15:18:25 +0200 Subject: [PATCH] fix: test --- .../hooks/__tests__/useNotificationRegistrations.test.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/components/settings/PushNotifications/hooks/__tests__/useNotificationRegistrations.test.ts b/src/components/settings/PushNotifications/hooks/__tests__/useNotificationRegistrations.test.ts index bfff0b0455..b9ac1646c5 100644 --- a/src/components/settings/PushNotifications/hooks/__tests__/useNotificationRegistrations.test.ts +++ b/src/components/settings/PushNotifications/hooks/__tests__/useNotificationRegistrations.test.ts @@ -6,9 +6,11 @@ import * as sdk from '@safe-global/safe-gateway-typescript-sdk' import { renderHook } from '@/tests/test-utils' import { useNotificationRegistrations } from '../useNotificationRegistrations' import * as web3 from '@/hooks/wallets/web3' +import * as wallet from '@/hooks/wallets/useWallet' import * as logic from '../../logic' import * as preferences from '../useNotificationPreferences' import * as notificationsSlice from '@/store/notificationsSlice' +import type { ConnectedWallet } from '@/services/onboard' jest.mock('@safe-global/safe-gateway-typescript-sdk') @@ -29,6 +31,12 @@ describe('useNotificationRegistrations', () => { beforeEach(() => { const mockProvider = new Web3Provider(jest.fn()) jest.spyOn(web3, 'useWeb3').mockImplementation(() => mockProvider) + jest.spyOn(wallet, 'default').mockImplementation( + () => + ({ + label: 'MetaMask', + } as unknown as ConnectedWallet), + ) }) const registerDeviceSpy = jest.spyOn(sdk, 'registerDevice')