Merge branch 'renovate/all-minor-patch' into 'main'
[ProtonMail-WebClient.git] / packages / testing / lib / mockUseNotifications.ts
blob469a4be8fbd5dff6147ed7572d556a72c5856761
1 import * as useNotificationsModule from '@proton/components/hooks/useNotifications';
3 export const mockUseNotifications = (value?: Partial<ReturnType<typeof useNotificationsModule.default>>) => {
4     const mockedUseNotifications = jest.spyOn(useNotificationsModule, 'default');
6     mockedUseNotifications.mockReturnValue({
7         setOffset: jest.fn(),
8         removeDuplicate: jest.fn(),
9         createNotification: jest.fn(),
10         removeNotification: jest.fn(),
11         hideNotification: jest.fn(),
12         clearNotifications: jest.fn(),
13         ...value,
14     });
16     return mockedUseNotifications;