2020-01-30 20:34:45 +01:00
|
|
|
import assert from 'assert'
|
2020-08-18 21:18:25 +02:00
|
|
|
import React from 'react'
|
2020-01-30 20:34:45 +01:00
|
|
|
import sinon from 'sinon'
|
|
|
|
import { mount } from 'enzyme'
|
|
|
|
import RevealSeedPage from '../reveal-seed'
|
|
|
|
|
2020-02-11 17:51:13 +01:00
|
|
|
describe('Reveal Seed Page', function () {
|
|
|
|
it('form submit', function () {
|
|
|
|
const props = {
|
|
|
|
history: {
|
|
|
|
push: sinon.spy(),
|
|
|
|
},
|
|
|
|
requestRevealSeedWords: sinon.stub().resolves(),
|
|
|
|
}
|
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
|
|
|
},
|
2020-11-03 00:41:28 +01:00
|
|
|
})
|
2020-01-30 20:34:45 +01:00
|
|
|
|
|
|
|
wrapper.find('form').simulate('submit')
|
|
|
|
assert(props.requestRevealSeedWords.calledOnce)
|
|
|
|
})
|
|
|
|
})
|