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.
51 lines
1.4 KiB
51 lines
1.4 KiB
4 years ago
|
import assert from 'assert';
|
||
|
import React from 'react';
|
||
|
import sinon from 'sinon';
|
||
4 years ago
|
import { mountWithRouter } from '../../../../test/lib/render-helpers';
|
||
|
import CreateAccountPage from '.';
|
||
5 years ago
|
|
||
5 years ago
|
describe('Create Account Page', function () {
|
||
4 years ago
|
let wrapper;
|
||
5 years ago
|
|
||
|
const props = {
|
||
|
history: {
|
||
|
push: sinon.spy(),
|
||
|
},
|
||
|
location: {
|
||
|
pathname: '/new-account',
|
||
|
},
|
||
4 years ago
|
};
|
||
5 years ago
|
|
||
5 years ago
|
before(function () {
|
||
4 years ago
|
wrapper = mountWithRouter(<CreateAccountPage {...props} />);
|
||
|
});
|
||
5 years ago
|
|
||
5 years ago
|
afterEach(function () {
|
||
4 years ago
|
props.history.push.resetHistory();
|
||
|
});
|
||
5 years ago
|
|
||
5 years ago
|
it('clicks create account and routes to new-account path', function () {
|
||
4 years ago
|
const createAccount = wrapper.find('.new-account__tabs__tab').at(0);
|
||
|
createAccount.simulate('click');
|
||
|
assert.strictEqual(props.history.push.getCall(0).args[0], '/new-account');
|
||
|
});
|
||
5 years ago
|
|
||
5 years ago
|
it('clicks import account and routes to import new account path', function () {
|
||
4 years ago
|
const importAccount = wrapper.find('.new-account__tabs__tab').at(1);
|
||
|
importAccount.simulate('click');
|
||
4 years ago
|
assert.strictEqual(
|
||
|
props.history.push.getCall(0).args[0],
|
||
|
'/new-account/import',
|
||
4 years ago
|
);
|
||
|
});
|
||
5 years ago
|
|
||
5 years ago
|
it('clicks connect HD Wallet and routes to connect new account path', function () {
|
||
4 years ago
|
const connectHdWallet = wrapper.find('.new-account__tabs__tab').at(2);
|
||
|
connectHdWallet.simulate('click');
|
||
4 years ago
|
assert.strictEqual(
|
||
|
props.history.push.getCall(0).args[0],
|
||
|
'/new-account/connect',
|
||
4 years ago
|
);
|
||
|
});
|
||
|
});
|