Cleanup - unused files / unused exports / duplicate exports
[ProtonMail-WebClient.git] / packages / components / containers / forward / ForwardStatus.spec.tsx
blob744b5df550a7494931e7ea57a1a745b7d80f6ea2
1 import { render } from '@testing-library/react';
3 import type { OutgoingAddressForwarding } from '@proton/shared/lib/interfaces';
4 import { ForwardingState } from '@proton/shared/lib/interfaces';
6 import ForwardStatus from './ForwardStatus';
8 describe('ForwardStatus', () => {
9     const setup = (state: ForwardingState) => {
10         const utils = render(<ForwardStatus forward={{ State: state } as OutgoingAddressForwarding} />);
11         return { ...utils };
12     };
13     describe('when forward is pending', () => {
14         it('should render a pending badge', () => {
15             const { getByText } = setup(ForwardingState.Pending);
16             expect(getByText('Pending')).toBeInTheDocument();
17         });
18     });
20     describe('when forward is active', () => {
21         it('should render an active badge', () => {
22             const { getByText } = setup(ForwardingState.Active);
23             expect(getByText('Active')).toBeInTheDocument();
24         });
25     });
27     describe('when forward is outdated', () => {
28         it('should render an outdated badge', () => {
29             const { getByText } = setup(ForwardingState.Outdated);
30             expect(getByText('Outdated')).toBeInTheDocument();
31         });
32     });
34     describe('when forward is paused', () => {
35         it('should render a paused badge', () => {
36             const { getByText } = setup(ForwardingState.Paused);
37             expect(getByText('Paused')).toBeInTheDocument();
38         });
39     });
41     describe('when forward is rejected', () => {
42         it('should render a rejected badge', () => {
43             const { getByText } = setup(ForwardingState.Rejected);
44             expect(getByText('Declined')).toBeInTheDocument();
45         });
46     });
47 });