1 import * as useAddressKeysModule from '@proton/account/addressKeys/hooks';
2 import type { Address, DecryptedAddressKey } from '@proton/shared/lib/interfaces';
4 export const mockUseAddressKeys = (value: [{ address: Address; keys: DecryptedAddressKey[] }[]?, boolean?] = []) => {
5 const [keys, cached = false] = value;
6 const mockedUseAddressKeys = vi.spyOn(useAddressKeysModule, 'useAddressesKeys');
7 mockedUseAddressKeys.mockReturnValue([keys ?? [], Boolean(cached)]);
8 return mockedUseAddressKeys;
11 export const mockUseGetAddressKeys = (value?: ReturnType<typeof useAddressKeysModule.useGetAddressKeys>) => {
12 const mockedUseGetAddressKeys = vi.spyOn(useAddressKeysModule, 'useGetAddressKeys');
13 mockedUseGetAddressKeys.mockReturnValue(value ?? vi.fn());
14 return mockedUseGetAddressKeys;