mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-02 14:15:06 +01:00
31 lines
824 B
JavaScript
31 lines
824 B
JavaScript
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();
|
|
});
|
|
});
|