1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-24 02:58:09 +01:00
metamask-extension/ui/app/pages/first-time-flow/end-of-flow/tests/end-of-flow.test.js
Whymarrh Whitby 4f3fc95d50
Update ESLint rules for test suite (#8023)
* Use @metamask/eslint-config@1.1.0
* Use eslint-plugin-mocha@6.2.2
* Mark root ESLint config as root
* Update Mocha ESLint rules with shared ESLint config
2020-02-11 13:21:13 -03:30

39 lines
993 B
JavaScript

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', function () {
let wrapper
const props = {
history: {
push: sinon.spy(),
},
completeOnboarding: 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.completeOnboarding.calledOnce)
assert(props.history.push.calledOnceWithExactly(DEFAULT_ROUTE))
done()
})
})
})