mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-11-28 05:12:18 +01:00
76a2a9bb8b
* @metamask/eslint-config@5.0.0 * Update eslintrc and prettierrc * yarn lint:fix
38 lines
967 B
JavaScript
38 lines
967 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(),
|
|
},
|
|
setCompletedOnboarding: sinon.spy(),
|
|
};
|
|
|
|
beforeEach(function () {
|
|
wrapper = mountWithRouter(<EndOfFlowScreen.WrappedComponent {...props} />);
|
|
});
|
|
|
|
it('renders', function () {
|
|
assert.strictEqual(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();
|
|
});
|
|
});
|
|
});
|