1 import { useUser } from '@proton/account/user/hooks';
2 import { renderWithProviders } from '@proton/components/containers/contacts/tests/render';
3 import type { Address } from '@proton/shared/lib/interfaces';
4 import { ForwardingState, ForwardingType } from '@proton/shared/lib/interfaces';
13 } from '@proton/testing';
15 import IncomingForwardTable from './IncomingForwardTable';
17 jest.mock('@proton/account/user/hooks');
18 const mockedUseUser = useUser as jest.MockedFunction<typeof useUser>;
19 mockedUseUser.mockReturnValue([{}] as any);
21 const IncomingForwardTableContext = applyHOCs(
28 )(IncomingForwardTable);
30 describe('IncomingForwardTable', () => {
35 Email: 'forwardeeEmail',
38 const chainedEmails = [''];
42 ForwardeeAddressID: 'addressID',
43 ForwarderEmail: 'forwarderEmail',
45 Type: ForwardingType.InternalEncrypted,
46 State: ForwardingState.Active,
51 const utils = renderWithProviders(
52 <IncomingForwardTableContext
53 forwardings={forwardings}
55 chainedEmails={chainedEmails}
60 describe('when we display incoming address forwarding', () => {
61 it('should show forwarder email address', () => {
62 const { getByText } = setup();
63 expect(getByText('forwarderEmail')).toBeInTheDocument();
66 it('should show forwardee email address', () => {
67 const { getByText } = setup();
68 expect(getByText('forwardeeEmail')).toBeInTheDocument();