2021-02-04 19:15:23 +01:00
|
|
|
import React from 'react';
|
|
|
|
import sinon from 'sinon';
|
|
|
|
import { mount } from 'enzyme';
|
2021-03-16 22:00:08 +01:00
|
|
|
import RevealSeedPage from './reveal-seed';
|
2020-01-30 20:34:45 +01:00
|
|
|
|
2021-04-15 20:01:46 +02:00
|
|
|
describe('Reveal Seed Page', () => {
|
|
|
|
it('form submit', () => {
|
2020-02-11 17:51:13 +01:00
|
|
|
const props = {
|
|
|
|
history: {
|
|
|
|
push: sinon.spy(),
|
|
|
|
},
|
|
|
|
requestRevealSeedWords: sinon.stub().resolves(),
|
2021-04-15 20:01:46 +02:00
|
|
|
mostRecentOverviewPage: '/',
|
2021-02-04 19:15:23 +01:00
|
|
|
};
|
2020-11-03 00:41:28 +01:00
|
|
|
const wrapper = mount(<RevealSeedPage.WrappedComponent {...props} />, {
|
|
|
|
context: {
|
|
|
|
t: (str) => str,
|
2020-07-14 17:20:41 +02:00
|
|
|
},
|
2021-02-04 19:15:23 +01:00
|
|
|
});
|
2020-01-30 20:34:45 +01:00
|
|
|
|
2021-02-04 19:15:23 +01:00
|
|
|
wrapper.find('form').simulate('submit');
|
2021-04-15 20:01:46 +02:00
|
|
|
expect(props.requestRevealSeedWords.calledOnce).toStrictEqual(true);
|
2021-02-04 19:15:23 +01:00
|
|
|
});
|
|
|
|
});
|