2021-02-04 19:15:23 +01:00
|
|
|
import React from 'react';
|
2022-10-20 20:20:49 +02:00
|
|
|
import { renderWithProvider } from '../../../../test/lib/render-helpers';
|
2023-01-18 15:47:29 +01:00
|
|
|
import TransactionStatusLabel from '.';
|
2018-11-14 01:51:46 +01:00
|
|
|
|
2023-01-18 15:47:29 +01:00
|
|
|
describe('TransactionStatusLabel Component', () => {
|
2021-04-15 20:01:46 +02:00
|
|
|
it('should render CONFIRMED properly', () => {
|
2022-10-20 20:20:49 +02:00
|
|
|
const confirmedProps = {
|
|
|
|
status: 'confirmed',
|
|
|
|
date: 'June 1',
|
|
|
|
};
|
|
|
|
|
|
|
|
const { container } = renderWithProvider(
|
2023-01-18 15:47:29 +01:00
|
|
|
<TransactionStatusLabel {...confirmedProps} />,
|
2021-02-04 19:15:23 +01:00
|
|
|
);
|
2018-11-14 01:51:46 +01:00
|
|
|
|
2022-10-20 20:20:49 +02:00
|
|
|
expect(container).toMatchSnapshot();
|
2021-02-04 19:15:23 +01:00
|
|
|
});
|
2020-06-10 22:38:34 +02:00
|
|
|
|
2021-04-15 20:01:46 +02:00
|
|
|
it('should render PENDING properly when status is APPROVED', () => {
|
2022-10-20 20:20:49 +02:00
|
|
|
const props = {
|
|
|
|
status: 'approved',
|
|
|
|
isEarliestNonce: true,
|
|
|
|
error: { message: 'test-title' },
|
|
|
|
};
|
2020-06-10 22:38:34 +02:00
|
|
|
|
2023-01-18 15:47:29 +01:00
|
|
|
const { container } = renderWithProvider(
|
|
|
|
<TransactionStatusLabel {...props} />,
|
|
|
|
);
|
2022-10-20 20:20:49 +02:00
|
|
|
|
|
|
|
expect(container).toMatchSnapshot();
|
2021-02-04 19:15:23 +01:00
|
|
|
});
|
2018-11-14 01:51:46 +01:00
|
|
|
|
2021-04-15 20:01:46 +02:00
|
|
|
it('should render PENDING properly', () => {
|
2022-10-20 20:20:49 +02:00
|
|
|
const props = {
|
|
|
|
date: 'June 1',
|
|
|
|
status: 'submitted',
|
|
|
|
isEarliestNonce: true,
|
|
|
|
};
|
|
|
|
|
2023-01-18 15:47:29 +01:00
|
|
|
const { container } = renderWithProvider(
|
|
|
|
<TransactionStatusLabel {...props} />,
|
|
|
|
);
|
2018-11-14 01:51:46 +01:00
|
|
|
|
2022-10-20 20:20:49 +02:00
|
|
|
expect(container).toMatchSnapshot();
|
2021-02-04 19:15:23 +01:00
|
|
|
});
|
2020-06-10 22:38:34 +02:00
|
|
|
|
2021-04-15 20:01:46 +02:00
|
|
|
it('should render QUEUED properly', () => {
|
2022-10-20 20:20:49 +02:00
|
|
|
const props = {
|
|
|
|
status: 'queued',
|
|
|
|
};
|
2020-06-10 22:38:34 +02:00
|
|
|
|
2023-01-18 15:47:29 +01:00
|
|
|
const { container } = renderWithProvider(
|
|
|
|
<TransactionStatusLabel {...props} />,
|
|
|
|
);
|
2022-10-20 20:20:49 +02:00
|
|
|
|
|
|
|
expect(container).toMatchSnapshot();
|
2021-02-04 19:15:23 +01:00
|
|
|
});
|
2020-06-10 22:38:34 +02:00
|
|
|
|
2021-04-15 20:01:46 +02:00
|
|
|
it('should render UNAPPROVED properly', () => {
|
2022-10-20 20:20:49 +02:00
|
|
|
const props = {
|
|
|
|
status: 'unapproved',
|
|
|
|
};
|
|
|
|
|
2023-01-18 15:47:29 +01:00
|
|
|
const { container } = renderWithProvider(
|
|
|
|
<TransactionStatusLabel {...props} />,
|
|
|
|
);
|
2020-06-10 22:38:34 +02:00
|
|
|
|
2022-10-20 20:20:49 +02:00
|
|
|
expect(container).toMatchSnapshot();
|
2021-02-04 19:15:23 +01:00
|
|
|
});
|
|
|
|
});
|