1 import * as useAddressesModule from '@proton/account/addresses/hooks';
2 import type { Address } from '@proton/shared/lib/interfaces';
4 import { buildAddress } from '../builders/address';
6 export const mockUseAddresses = (value: [Address[]?, boolean?] = []) => {
7 const [addresses, cached = false] = value;
8 const mockedUseAddress = jest.spyOn(useAddressesModule, 'useAddresses');
9 mockedUseAddress.mockReturnValue([addresses ?? [buildAddress()], Boolean(cached)]);
10 return mockedUseAddress;