Merge branch 'renovate/all-minor-patch' into 'main'
[ProtonMail-WebClient.git] / packages / wallet / tests / mocks / useWalletAccountExchangeRate.ts
blobda4751a8847ffa3de6339190ed29896ce31efb49
1 import { exchangeRate } from '@proton/wallet/tests';
3 import * as useWalletAccountExchangeRateModule from '../../store/hooks/useWalletAccountExchangeRate';
5 export const mockUseWalletAccountExchangeRate = (
6     mockedValue?: ReturnType<typeof useWalletAccountExchangeRateModule.useWalletAccountExchangeRate>[0] | null
7 ) => {
8     const spy = vi.spyOn(useWalletAccountExchangeRateModule, 'useWalletAccountExchangeRate');
10     spy.mockReturnValue([mockedValue === undefined ? exchangeRate : (mockedValue ?? undefined), false]);
12     return spy;