1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-04 23:14:56 +01:00
metamask-extension/ui/pages/keychains/restore-vault.test.js

45 lines
1.9 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import React from 'react';
import sinon from 'sinon';
import configureMockStore from 'redux-mock-store';
import { renderWithProvider } from '../../../test/lib/render-helpers';
import RestoreVaultPage from './restore-vault';
describe('Restore vault Component', () => {
it('clicks imports seed button', () => {
const props = {
history: {
push: sinon.spy(),
},
};
const { getByText, getByRole, getAllByRole } = renderWithProvider(
<RestoreVaultPage {...props} />,
configureMockStore()({
metamask: { currentLocale: 'en' },
appState: { isLoading: false },
}),
);
expect(getByText('Reset wallet')).toBeInTheDocument();
expect(
getByText(
'MetaMask does not keep a copy of your password. If youre having trouble unlocking your account, you will need to reset your wallet. You can do this by providing the Secret Recovery Phrase you used when you set up your wallet.',
),
).toBeInTheDocument();
expect(
getByText(
'This action will delete your current wallet and Secret Recovery Phrase from this device, along with the list of accounts youve curated. After resetting with a Secret Recovery Phrase, youll see a list of accounts based on the Secret Recovery Phrase you use to reset. This new list will automatically include accounts that have a balance. Youll also be able to created previously. Custom accounts that youve imported will need to be , and any custom tokens youve added to an account will need to be as well.',
),
).toBeInTheDocument();
expect(
getByRole('link', { name: 're-add any other accounts' }),
).toBeInTheDocument();
expect(getAllByRole('link', { name: 're-added' })).toHaveLength(2);
expect(
getByText(
'Make sure youre using the correct Secret Recovery Phrase before proceeding. You will not be able to undo this.',
),
).toBeInTheDocument();
});
});