2021-04-23 00:31:13 +02:00
|
|
|
import React from 'react';
|
|
|
|
import sinon from 'sinon';
|
|
|
|
import configureMockStore from 'redux-mock-store';
|
|
|
|
import { fireEvent } from '@testing-library/react';
|
2021-04-28 21:53:59 +02:00
|
|
|
import { renderWithProvider } from '../../../test/lib/render-helpers';
|
2021-04-23 00:31:13 +02:00
|
|
|
import UnlockPage from './unlock-page.component';
|
|
|
|
|
|
|
|
describe('Unlock Page Component', () => {
|
|
|
|
it('clicks imports seed button', () => {
|
|
|
|
const props = {
|
|
|
|
history: {
|
|
|
|
push: sinon.spy(),
|
|
|
|
},
|
|
|
|
isUnlocked: false,
|
|
|
|
onRestore: sinon.spy(),
|
|
|
|
onSubmit: sinon.spy(),
|
|
|
|
forceUpdateMetamaskState: sinon.spy(),
|
|
|
|
showOptInModal: sinon.spy(),
|
|
|
|
};
|
|
|
|
|
|
|
|
const { getByText } = renderWithProvider(
|
|
|
|
<UnlockPage {...props} />,
|
|
|
|
configureMockStore()({ metamask: { currentLocale: 'en' } }),
|
|
|
|
);
|
|
|
|
|
2021-05-07 15:07:43 +02:00
|
|
|
fireEvent.click(getByText('import using Secret Recovery Phrase'));
|
2021-04-23 00:31:13 +02:00
|
|
|
expect(props.onRestore.calledOnce).toStrictEqual(true);
|
|
|
|
});
|
|
|
|
});
|