1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-01 21:57:06 +01:00
metamask-extension/ui/components/app/modals/transaction-confirmed/transaction-confirmed.test.js

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();
});
});