1 import * as useSubscriptionModule from '@proton/account/subscription/hooks';
2 import type { SubscriptionModel } from '@proton/shared/lib/interfaces';
4 import { buildSubscription } from '../builders';
6 export const mockUseSubscription = (value: [Partial<SubscriptionModel>?, boolean?] = []) => {
7 const [subscription, cached = false] = value;
8 const mockedUseSubscription = jest.spyOn(useSubscriptionModule, 'useSubscription');
9 mockedUseSubscription.mockReturnValue([buildSubscription(subscription), Boolean(cached)]);
10 return mockedUseSubscription;