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} />);
13 describe('when forward is pending', () => {
14 it('should render a pending badge', () => {
15 const { getByText } = setup(ForwardingState.Pending);
16 expect(getByText('Pending')).toBeInTheDocument();
20 describe('when forward is active', () => {
21 it('should render an active badge', () => {
22 const { getByText } = setup(ForwardingState.Active);
23 expect(getByText('Active')).toBeInTheDocument();
27 describe('when forward is outdated', () => {
28 it('should render an outdated badge', () => {
29 const { getByText } = setup(ForwardingState.Outdated);
30 expect(getByText('Outdated')).toBeInTheDocument();
34 describe('when forward is paused', () => {
35 it('should render a paused badge', () => {
36 const { getByText } = setup(ForwardingState.Paused);
37 expect(getByText('Paused')).toBeInTheDocument();
41 describe('when forward is rejected', () => {
42 it('should render a rejected badge', () => {
43 const { getByText } = setup(ForwardingState.Rejected);
44 expect(getByText('Declined')).toBeInTheDocument();