mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-11-28 05:12:18 +01:00
27 lines
744 B
JavaScript
27 lines
744 B
JavaScript
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(
|
|
<TransactionConfirmed.WrappedComponent {...props} />,
|
|
{
|
|
context: {
|
|
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);
|
|
});
|
|
});
|