Merge branch 'renovate/all-minor-patch' into 'main'
[ProtonMail-WebClient.git] / packages / wallet / tests / mocks / useGetExchangeRate.ts
blob9fc09d56b0830024fbe824113e8c473eb7ce6048
1 import type { MockedFunction } from 'vitest';
3 import { exchangeRate } from '@proton/wallet/tests';
5 import * as useExchangeRateModule from '../../store/hooks/useExchangeRate';
7 export const mockUseGetExchangeRate = (
8     mockedValue?: MockedFunction<ReturnType<typeof useExchangeRateModule.useGetExchangeRate>>
9 ) => {
10     const spy = vi.spyOn(useExchangeRateModule, 'useGetExchangeRate');
12     spy.mockReturnValue(mockedValue ?? vi.fn().mockResolvedValue(exchangeRate));
14     return spy;