You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
824 B
30 lines
824 B
import React from 'react';
|
|
import { fireEvent } from '@testing-library/react';
|
|
import { renderWithProvider } from '../../../../../test/lib/render-helpers';
|
|
import TransactionConfirmed from '.';
|
|
|
|
describe('Transaction Confirmed', () => {
|
|
it('should match snapshot', () => {
|
|
const { container } = renderWithProvider(
|
|
<TransactionConfirmed.WrappedComponent />,
|
|
);
|
|
|
|
expect(container).toMatchSnapshot();
|
|
});
|
|
|
|
it('clicks ok to submit and hide modal', () => {
|
|
const props = {
|
|
onSubmit: jest.fn(),
|
|
hideModal: jest.fn(),
|
|
};
|
|
|
|
const { queryByText } = renderWithProvider(
|
|
<TransactionConfirmed.WrappedComponent {...props} />,
|
|
);
|
|
|
|
fireEvent.click(queryByText('[ok]'));
|
|
|
|
expect(props.onSubmit).toHaveBeenCalled();
|
|
expect(props.hideModal).toHaveBeenCalled();
|
|
});
|
|
});
|
|
|