1 import * as useUserModule from '@proton/account/user/hooks';
2 import type { UserModel } from '@proton/shared/lib/interfaces';
4 import { buildUser } from '../builders';
6 export const mockUseUser = (value: [Partial<UserModel>?, boolean?] = []) => {
7 const [user, cached = false] = value;
8 const mockedUseUser = jest.spyOn(useUserModule, 'useUser');
9 mockedUseUser.mockReturnValue([buildUser(user), Boolean(cached)]);