mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-04 23:14:56 +01:00
ace7b0cda9
This reverts commit d91ce9c4b5
.
43 lines
1.1 KiB
JavaScript
43 lines
1.1 KiB
JavaScript
import React from 'react';
|
|
import configureMockStore from 'redux-mock-store';
|
|
import { fireEvent } from '@testing-library/react';
|
|
import thunk from 'redux-thunk';
|
|
import { renderWithProvider } from '../../../test/lib/render-helpers';
|
|
import RevealSeedPage from './reveal-seed';
|
|
|
|
const mockRequestRevealSeedWords = jest.fn().mockResolvedValue();
|
|
|
|
jest.mock('../../store/actions.js', () => ({
|
|
requestRevealSeedWords: () => mockRequestRevealSeedWords,
|
|
}));
|
|
|
|
describe('Reveal Seed Page', () => {
|
|
const mockState = {
|
|
history: {
|
|
mostRecentOverviewPage: '/',
|
|
},
|
|
};
|
|
const mockStore = configureMockStore([thunk])(mockState);
|
|
|
|
it('should match snapshot', () => {
|
|
const { container } = renderWithProvider(<RevealSeedPage />, mockStore);
|
|
|
|
expect(container).toMatchSnapshot();
|
|
});
|
|
|
|
it('form submit', () => {
|
|
const { queryByTestId, queryByText } = renderWithProvider(
|
|
<RevealSeedPage />,
|
|
mockStore,
|
|
);
|
|
|
|
fireEvent.change(queryByTestId('input-password'), {
|
|
target: { value: 'password' },
|
|
});
|
|
|
|
fireEvent.click(queryByText('Next'));
|
|
|
|
expect(mockRequestRevealSeedWords).toHaveBeenCalled();
|
|
});
|
|
});
|