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.
40 lines
971 B
40 lines
971 B
5 years ago
|
import React from 'react'
|
||
|
import assert from 'assert'
|
||
|
import sinon from 'sinon'
|
||
|
import { mountWithRouter } from '../../../../../../test/lib/render-helpers'
|
||
|
import { DEFAULT_ROUTE } from '../../../../helpers/constants/routes'
|
||
|
import EndOfFlowScreen from '../index'
|
||
|
|
||
|
describe('End of Flow Screen', () => {
|
||
|
let wrapper
|
||
|
|
||
|
const props = {
|
||
|
history: {
|
||
|
push: sinon.spy(),
|
||
|
},
|
||
|
completeOnboarding: sinon.spy(),
|
||
|
}
|
||
|
|
||
|
beforeEach(() => {
|
||
|
wrapper = mountWithRouter(
|
||
|
<EndOfFlowScreen.WrappedComponent {...props} />
|
||
|
)
|
||
|
})
|
||
|
|
||
|
it('renders', () => {
|
||
|
assert.equal(wrapper.length, 1)
|
||
|
})
|
||
|
|
||
|
it('', (done) => {
|
||
|
const endOfFlowButton = wrapper.find('.btn-primary.first-time-flow__button')
|
||
|
endOfFlowButton.simulate('click')
|
||
|
|
||
|
setImmediate(() => {
|
||
|
assert(props.completeOnboarding.calledOnce)
|
||
|
assert(props.history.push.calledOnce)
|
||
|
assert.equal(props.history.push.getCall(0).args[0], DEFAULT_ROUTE)
|
||
|
done()
|
||
|
})
|
||
|
})
|
||
|
})
|