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.
29 lines
759 B
29 lines
759 B
4 years ago
|
import React from 'react';
|
||
|
import sinon from 'sinon';
|
||
|
import { mount } from 'enzyme';
|
||
4 years ago
|
import TransactionConfirmed from './transaction-confirmed.container';
|
||
5 years ago
|
|
||
4 years ago
|
describe('Transaction Confirmed', () => {
|
||
|
it('clicks ok to submit and hide modal', () => {
|
||
5 years ago
|
const props = {
|
||
|
onSubmit: sinon.spy(),
|
||
|
hideModal: sinon.spy(),
|
||
4 years ago
|
};
|
||
5 years ago
|
const wrapper = mount(
|
||
4 years ago
|
<TransactionConfirmed.WrappedComponent {...props} />,
|
||
|
{
|
||
5 years ago
|
context: {
|
||
5 years ago
|
t: (str) => str,
|
||
5 years ago
|
},
|
||
4 years ago
|
},
|
||
4 years ago
|
);
|
||
|
const submit = wrapper.find(
|
||
|
'.btn-secondary.modal-container__footer-button',
|
||
|
);
|
||
|
submit.simulate('click');
|
||
5 years ago
|
|
||
4 years ago
|
expect(props.onSubmit.calledOnce).toStrictEqual(true);
|
||
|
expect(props.hideModal.calledOnce).toStrictEqual(true);
|
||
4 years ago
|
});
|
||
|
});
|