Merge branch 'renovate/all-minor-patch' into 'main'
[ProtonMail-WebClient.git] / packages / wallet / tests / mocks / useBitcoinNetwork.ts
blob66c8e6d1ae5eb7ff6ea8d460541cc8a1594c0c00
1 import { WasmNetwork } from '@proton/andromeda';
3 import * as useBitcoinNetworkModule from '../../store/hooks/useBitcoinNetwork';
5 export const mockUseBitcoinNetwork = (
6     mockedValue?: Partial<ReturnType<typeof useBitcoinNetworkModule.useBitcoinNetwork>>
7 ) => {
8     const spy = vi.spyOn(useBitcoinNetworkModule, 'useBitcoinNetwork');
10     spy.mockReturnValue([mockedValue?.[0] ?? WasmNetwork.Testnet, mockedValue?.[1] ?? false]);
12     return spy;
15 export const mockUseGetBitcoinNetwork = (mockedValue?: WasmNetwork) => {
16     const spy = vi.spyOn(useBitcoinNetworkModule, 'useGetBitcoinNetwork');
18     spy.mockImplementation(() => async () => mockedValue ?? WasmNetwork.Testnet);
20     return spy;