1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-01 21:57:06 +01:00
metamask-extension/ui/pages/first-time-flow/seed-phrase/reveal-seed-phrase/reveal-seed-phrase.test.js
Thomas Huang 646dbaaff2
Continue converting tests from enzyme to @testing-library/react (#16373)
* Add transaction activity log component

* Remove duplicate tx activity log snapshot.

* Convert Identicon test to tlr.

* Convert Metafoxlogo test to tlr.

* Convert Reveal Seed Phrase test to tlr.

* Consolidate and convert Send Footer test to tlr.

* Convert Settings test to tlr.

* Consolidate and convert security tab test to tlr.

* Convert null selectedOption to empty string, and add test id to Dropdown component.

* Add Send state to mock-state

* Lint mock-state.json
2022-11-04 13:56:24 -07:00

47 lines
1.2 KiB
JavaScript

import React from 'react';
import sinon from 'sinon';
import { fireEvent } from '@testing-library/react';
import configureMockStore from 'redux-mock-store';
import { renderWithProvider } from '../../../../../test/lib/render-helpers';
import RevealSeedPhrase from '.';
describe('Reveal Secret Recovery Phrase', () => {
const TEST_SEED =
'debris dizzy just program just float decrease vacant alarm reduce speak stadium';
const props = {
history: {
push: sinon.spy(),
},
seedPhrase: TEST_SEED,
setSeedPhraseBackedUp: sinon.spy(),
setCompletedOnboarding: sinon.spy(),
};
const mockState = {
metamask: {},
};
const mockStore = configureMockStore()(mockState);
it('should match snapshot', () => {
const { container } = renderWithProvider(
<RevealSeedPhrase {...props} />,
mockStore,
);
expect(container).toMatchSnapshot();
});
it('clicks to reveal shows seed phrase', () => {
const { queryByTestId } = renderWithProvider(
<RevealSeedPhrase {...props} />,
mockStore,
);
fireEvent.click(queryByTestId('reveal-seed-blocker'));
expect(queryByTestId('showing-seed-phrase')).toBeInTheDocument();
});
});