1 import * as useAddressesModule from '@proton/account/addresses/hooks';
2 import type { Address } from '@proton/shared/lib/interfaces';
4 export const mockUseAddresses = (value: [Address[]?, boolean?] = []) => {
5 const [addresses, cached = false] = value;
6 const mockedUseAddresses = vi.spyOn(useAddressesModule, 'useAddresses');
7 mockedUseAddresses.mockReturnValue([addresses ?? [], Boolean(cached)]);
8 return mockedUseAddresses;
11 export const mockUseGetAddresses = (value: Address[] = []) => {
12 const mockedUseAddresses = vi.spyOn(useAddressesModule, 'useGetAddresses');
13 mockedUseAddresses.mockReturnValue(vi.fn(async () => value ?? []));
14 return mockedUseAddresses;