mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-05 07:24:56 +01:00
392b08a5c4
* Fix: show whats new to users who created, not imported, a new wallet, but not on their first session * Fix tests Hide `Improved token detection is here` & `Scam and security risks` whats new * Fix unit test Co-authored-by: PeterYinusa <peter.yinusa@consensys.net>
38 lines
1.1 KiB
JavaScript
38 lines
1.1 KiB
JavaScript
import React from 'react';
|
|
import sinon from 'sinon';
|
|
import { fireEvent, screen } from '@testing-library/react';
|
|
import { tick } from '../../../../test/lib/tick';
|
|
import { renderWithProvider } from '../../../../test/lib/render-helpers';
|
|
import { DEFAULT_ROUTE } from '../../../helpers/constants/routes';
|
|
import EndOfFlowScreen from './end-of-flow.container';
|
|
|
|
describe('End of Flow Screen', () => {
|
|
const props = {
|
|
history: {
|
|
push: sinon.stub(),
|
|
},
|
|
setCompletedOnboarding: sinon.stub().resolves(),
|
|
setOnBoardedInThisUISession: sinon.stub(),
|
|
};
|
|
|
|
beforeEach(() => {
|
|
renderWithProvider(<EndOfFlowScreen.WrappedComponent {...props} />);
|
|
});
|
|
|
|
it('should render', () => {
|
|
const endOfFlow = screen.queryByTestId('end-of-flow');
|
|
expect(endOfFlow).toBeInTheDocument();
|
|
});
|
|
|
|
it('should navigate to the default route on click', async () => {
|
|
const endOfFlowButton = screen.getByTestId('EOF-complete-button');
|
|
fireEvent.click(endOfFlowButton);
|
|
|
|
await tick();
|
|
|
|
expect(
|
|
props.history.push.calledOnceWithExactly(DEFAULT_ROUTE),
|
|
).toStrictEqual(true);
|
|
});
|
|
});
|