Merge branch 'renovate/all-minor-patch' into 'main'
[ProtonMail-WebClient.git] / packages / testing / lib / mockUseContactEmailsCache.ts
blob1c91c6ac9f526b13a02daf05cc6fba09d53e2eb7
1 import * as useContactEmailsCacheModule from '@proton/components/containers/contacts/ContactEmailsProvider';
3 export const mockUseContactEmailsCache = (
4     value?: Partial<ReturnType<typeof useContactEmailsCacheModule.useContactEmailsCache>>
5 ) => {
6     const mockedUseContactEmailsCache = jest.spyOn(useContactEmailsCacheModule, 'useContactEmailsCache');
7     mockedUseContactEmailsCache.mockReturnValue({
8         contactEmails: [],
9         contactGroups: [],
10         contactEmailsMap: {},
11         contactEmailsMapWithDuplicates: {},
12         groupsWithContactsMap: {},
13         ...value,
14     });
16     return mockedUseContactEmailsCache;