1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-25 03:20:23 +01:00
metamask-extension/ui/app/pages/first-time-flow/end-of-flow/tests/end-of-flow.test.js
Whymarrh Whitby b6ccd22d6c
Update ESLint shared config to v3 (#9274)
Co-authored-by: Mark Stacey <markjstacey@gmail.com>
2020-08-19 13:57:05 -02:30

37 lines
901 B
JavaScript

import assert from 'assert'
import React from 'react'
import sinon from 'sinon'
import { mountWithRouter } from '../../../../../../test/lib/render-helpers'
import { DEFAULT_ROUTE } from '../../../../helpers/constants/routes'
import EndOfFlowScreen from '..'
describe('End of Flow Screen', function () {
let wrapper
const props = {
history: {
push: sinon.spy(),
},
}
beforeEach(function () {
wrapper = mountWithRouter(
<EndOfFlowScreen.WrappedComponent {...props} />,
)
})
it('renders', function () {
assert.equal(wrapper.length, 1)
})
it('should navigate to the default route on click', function (done) {
const endOfFlowButton = wrapper.find('.btn-primary.first-time-flow__button')
endOfFlowButton.simulate('click')
setImmediate(() => {
assert(props.history.push.calledOnceWithExactly(DEFAULT_ROUTE))
done()
})
})
})