mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
5d1c9313db
* Various component tests and some conditional statements Conditional in account-menu in removeAccount when keyring sometimes is not initially provideed Conditional on unlock-page when there is no target.getBoundingClientRect on the element. * Update helpers * Remove component debugging * Add default params for render helpers * Remove stubComponent for old Mascot Changes in https://github.com/MetaMask/metamask-extension/pull/7893 has prevented the need to stub it out. Change logout to lock in account-menu test
47 lines
1.3 KiB
JavaScript
47 lines
1.3 KiB
JavaScript
import React from 'react'
|
|
import assert from 'assert'
|
|
import sinon from 'sinon'
|
|
import { mountWithRouter } from '../../../../../../test/lib/render-helpers'
|
|
import SelectAction from '../index'
|
|
|
|
describe('Selection Action', () => {
|
|
let wrapper
|
|
|
|
const props = {
|
|
isInitialized: false,
|
|
setFirstTimeFlowType: sinon.spy(),
|
|
history: {
|
|
push: sinon.spy(),
|
|
},
|
|
}
|
|
|
|
beforeEach(() => {
|
|
wrapper = mountWithRouter(
|
|
<SelectAction.WrappedComponent {...props} />
|
|
)
|
|
})
|
|
|
|
afterEach(() => {
|
|
props.setFirstTimeFlowType.resetHistory()
|
|
props.history.push.resetHistory()
|
|
})
|
|
|
|
it('clicks import wallet to route to import FTF', () => {
|
|
const importWalletButton = wrapper.find('.btn-primary.first-time-flow__button').at(0)
|
|
importWalletButton.simulate('click')
|
|
|
|
assert(props.setFirstTimeFlowType.calledOnce)
|
|
assert.equal(props.setFirstTimeFlowType.getCall(0).args[0], 'import')
|
|
assert(props.history.push.calledOnce)
|
|
})
|
|
|
|
it('clicks create wallet to route to create FTF ', () => {
|
|
const createWalletButton = wrapper.find('.btn-primary.first-time-flow__button').at(1)
|
|
createWalletButton.simulate('click')
|
|
|
|
assert(props.setFirstTimeFlowType.calledOnce)
|
|
assert.equal(props.setFirstTimeFlowType.getCall(0).args[0], 'create')
|
|
assert(props.history.push.calledOnce)
|
|
})
|
|
})
|