1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-04 23:14:56 +01:00
metamask-extension/ui/pages/first-time-flow/end-of-flow/end-of-flow.test.js
2021-04-28 14:53:59 -05:00

39 lines
988 B
JavaScript

import React from 'react';
import sinon from 'sinon';
import { tick } from '../../../../test/lib/tick';
import { mountWithRouter } from '../../../../test/lib/render-helpers';
import { DEFAULT_ROUTE } from '../../../helpers/constants/routes';
import EndOfFlowScreen from './end-of-flow.container';
describe('End of Flow Screen', () => {
let wrapper;
const props = {
history: {
push: sinon.stub(),
},
setCompletedOnboarding: sinon.stub().resolves(),
};
beforeEach(() => {
wrapper = mountWithRouter(<EndOfFlowScreen.WrappedComponent {...props} />);
});
it('renders', () => {
expect(wrapper).toHaveLength(1);
});
it('should navigate to the default route on click', async () => {
const endOfFlowButton = wrapper.find(
'.btn-primary.first-time-flow__button',
);
endOfFlowButton.simulate('click');
await tick();
expect(
props.history.push.calledOnceWithExactly(DEFAULT_ROUTE),
).toStrictEqual(true);
});
});