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

27 lines
744 B
JavaScript
Raw Normal View History

import React from 'react';
import sinon from 'sinon';
import { mount } from 'enzyme';
import TransactionConfirmed from './transaction-confirmed.container';
describe('Transaction Confirmed', () => {
it('clicks ok to submit and hide modal', () => {
const props = {
onSubmit: sinon.spy(),
hideModal: sinon.spy(),
};
const wrapper = mount(
2020-11-03 00:41:28 +01:00
<TransactionConfirmed.WrappedComponent {...props} />,
{
context: {
2020-02-15 21:34:12 +01:00
t: (str) => str,
},
},
);
const submit = wrapper.find('.btn-primary.modal-container__footer-button');
submit.simulate('click');
expect(props.onSubmit.calledOnce).toStrictEqual(true);
expect(props.hideModal.calledOnce).toStrictEqual(true);
});
});