2020-01-30 20:34:45 +01:00
|
|
|
import React from 'react'
|
|
|
|
import assert from 'assert'
|
|
|
|
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(),
|
|
|
|
}
|
|
|
|
const wrapper = mount(
|
2020-01-30 20:34:45 +01:00
|
|
|
<RevealSeedPage.WrappedComponent {...props} />, {
|
|
|
|
context: {
|
2020-02-15 21:34:12 +01:00
|
|
|
t: (str) => str,
|
2020-01-30 20:34:45 +01:00
|
|
|
},
|
|
|
|
}
|
|
|
|
)
|
|
|
|
|
|
|
|
wrapper.find('form').simulate('submit')
|
|
|
|
assert(props.requestRevealSeedWords.calledOnce)
|
|
|
|
})
|
|
|
|
})
|