2021-02-04 19:15:23 +01:00
|
|
|
import React from 'react';
|
2022-11-15 16:00:02 +01:00
|
|
|
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', () => {
|
2022-10-11 19:54:50 +02:00
|
|
|
it('form submit', () => {
|
2022-11-15 16:00:02 +01:00
|
|
|
const props = {
|
|
|
|
history: {
|
|
|
|
push: sinon.spy(),
|
|
|
|
},
|
|
|
|
requestRevealSeedWords: sinon.stub().resolves(),
|
|
|
|
mostRecentOverviewPage: '/',
|
|
|
|
};
|
|
|
|
const wrapper = mount(<RevealSeedPage.WrappedComponent {...props} />, {
|
|
|
|
context: {
|
|
|
|
t: (str) => str,
|
|
|
|
},
|
2021-02-04 19:15:23 +01:00
|
|
|
});
|
2020-01-30 20:34:45 +01:00
|
|
|
|
2022-11-15 16:00:02 +01:00
|
|
|
wrapper.find('form').simulate('submit');
|
|
|
|
expect(props.requestRevealSeedWords.calledOnce).toStrictEqual(true);
|
2021-02-04 19:15:23 +01:00
|
|
|
});
|
|
|
|
});
|