2021-02-04 19:15:23 +01:00
|
|
|
import React from 'react';
|
2022-10-11 19:54:50 +02:00
|
|
|
import { fireEvent } from '@testing-library/react';
|
|
|
|
import { renderWithProvider } from '../../../../../test/lib/render-helpers';
|
|
|
|
import TransactionConfirmed from '.';
|
2020-01-30 20:34:45 +01:00
|
|
|
|
2021-04-15 20:01:46 +02:00
|
|
|
describe('Transaction Confirmed', () => {
|
2022-10-11 19:54:50 +02:00
|
|
|
it('should match snapshot', () => {
|
|
|
|
const { container } = renderWithProvider(
|
|
|
|
<TransactionConfirmed.WrappedComponent />,
|
|
|
|
);
|
|
|
|
|
|
|
|
expect(container).toMatchSnapshot();
|
|
|
|
});
|
|
|
|
|
2021-04-15 20:01:46 +02:00
|
|
|
it('clicks ok to submit and hide modal', () => {
|
2020-02-11 17:51:13 +01:00
|
|
|
const props = {
|
2022-10-11 19:54:50 +02:00
|
|
|
onSubmit: jest.fn(),
|
|
|
|
hideModal: jest.fn(),
|
2021-02-04 19:15:23 +01:00
|
|
|
};
|
2022-10-11 19:54:50 +02:00
|
|
|
|
|
|
|
const { queryByText } = renderWithProvider(
|
2020-11-03 00:41:28 +01:00
|
|
|
<TransactionConfirmed.WrappedComponent {...props} />,
|
2021-02-04 19:15:23 +01:00
|
|
|
);
|
2020-01-30 20:34:45 +01:00
|
|
|
|
2022-10-11 19:54:50 +02:00
|
|
|
fireEvent.click(queryByText('[ok]'));
|
|
|
|
|
|
|
|
expect(props.onSubmit).toHaveBeenCalled();
|
|
|
|
expect(props.hideModal).toHaveBeenCalled();
|
2021-02-04 19:15:23 +01:00
|
|
|
});
|
|
|
|
});
|