Merge branch 'feat/inda-383-daily-stat' into 'main'
[ProtonMail-WebClient.git] / packages / testing / lib / vitest / mockUseConfig.ts
blob2077b2504f8490f694dfba4edfde4c30732fe7d4
1 import * as useConfigModule from '@proton/components/hooks/useConfig';
2 import { APPS, CLIENT_TYPES } from '@proton/shared/lib/constants';
3 import type { ProtonConfig } from '@proton/shared/lib/interfaces';
5 export const mockUseConfig = (value?: Partial<ProtonConfig>) => {
6     const spy = vi.spyOn(useConfigModule, 'default');
7     spy.mockReturnValue({
8         CLIENT_TYPE: CLIENT_TYPES.MAIL,
9         CLIENT_SECRET: 'string',
10         APP_VERSION: '0.0.999999',
11         APP_NAME: APPS.PROTONMAIL,
12         API_URL: '',
13         LOCALES: {},
14         DATE_VERSION: '',
15         COMMIT: '',
16         BRANCH: '',
17         SENTRY_DSN: '',
18         VERSION_PATH: '',
19         ...value,
20     });
21     return spy;