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.
52 lines
1.4 KiB
52 lines
1.4 KiB
4 years ago
|
import React from 'react';
|
||
|
import sinon from 'sinon';
|
||
4 years ago
|
import { mountWithRouter } from '../../../../test/lib/render-helpers';
|
||
4 years ago
|
import SelectAction from './select-action.container';
|
||
5 years ago
|
|
||
4 years ago
|
describe('Selection Action', () => {
|
||
4 years ago
|
let wrapper;
|
||
5 years ago
|
|
||
|
const props = {
|
||
|
isInitialized: false,
|
||
|
setFirstTimeFlowType: sinon.spy(),
|
||
|
history: {
|
||
|
push: sinon.spy(),
|
||
|
},
|
||
4 years ago
|
};
|
||
5 years ago
|
|
||
4 years ago
|
beforeEach(() => {
|
||
4 years ago
|
wrapper = mountWithRouter(<SelectAction.WrappedComponent {...props} />);
|
||
|
});
|
||
5 years ago
|
|
||
4 years ago
|
afterEach(() => {
|
||
4 years ago
|
props.setFirstTimeFlowType.resetHistory();
|
||
|
props.history.push.resetHistory();
|
||
|
});
|
||
5 years ago
|
|
||
4 years ago
|
it('clicks import wallet to route to import FTF', () => {
|
||
4 years ago
|
const importWalletButton = wrapper
|
||
|
.find('.btn-primary.first-time-flow__button')
|
||
4 years ago
|
.at(0);
|
||
|
importWalletButton.simulate('click');
|
||
5 years ago
|
|
||
4 years ago
|
expect(props.setFirstTimeFlowType.calledOnce).toStrictEqual(true);
|
||
|
expect(props.setFirstTimeFlowType.getCall(0).args[0]).toStrictEqual(
|
||
|
'import',
|
||
|
);
|
||
|
expect(props.history.push.calledOnce).toStrictEqual(true);
|
||
4 years ago
|
});
|
||
5 years ago
|
|
||
4 years ago
|
it('clicks create wallet to route to create FTF', () => {
|
||
4 years ago
|
const createWalletButton = wrapper
|
||
|
.find('.btn-primary.first-time-flow__button')
|
||
4 years ago
|
.at(1);
|
||
|
createWalletButton.simulate('click');
|
||
|
|
||
4 years ago
|
expect(props.setFirstTimeFlowType.calledOnce).toStrictEqual(true);
|
||
|
expect(props.setFirstTimeFlowType.getCall(0).args[0]).toStrictEqual(
|
||
|
'create',
|
||
|
);
|
||
|
expect(props.history.push.calledOnce).toStrictEqual(true);
|
||
4 years ago
|
});
|
||
|
});
|