add test: Import Account using private key of an already active account should result in an error (#13673)

feature/default_network_editable
Alex Donesky 3 years ago committed by GitHub
parent 6dd141ebfd
commit 7af75e13a2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 41
      test/e2e/tests/from-import-ui.spec.js

@ -231,6 +231,47 @@ describe('Metamask Import UI', function () {
}, },
); );
}); });
it('Import Account using private key of an already active account should result in an error', async function () {
const testPrivateKey =
'0x53CB0AB5226EEBF4D872113D98332C1555DC304443BEE1CF759D15798D3C55A9';
const ganacheOptions = {
accounts: [
{
secretKey: testPrivateKey,
balance: convertToHexValue(25000000000000000000),
},
],
};
await withFixtures(
{
fixtures: 'import-ui',
ganacheOptions,
title: this.test.title,
},
async ({ driver }) => {
await driver.navigate();
await driver.fill('#password', 'correct horse battery staple');
await driver.press('#password', driver.Key.ENTER);
// choose Import Account from the account menu
await driver.clickElement('.account-menu__icon');
await driver.clickElement({ text: 'Import Account', tag: 'div' });
// enter private key',
await driver.fill('#private-key-box', testPrivateKey);
await driver.clickElement({ text: 'Import', tag: 'button' });
// error should occur
await driver.waitForSelector({
css: '.error',
text: "The account you're are trying to import is a duplicate",
});
},
);
});
it('Connects to a Hardware wallet', async function () { it('Connects to a Hardware wallet', async function () {
const ganacheOptions = { const ganacheOptions = {
accounts: [ accounts: [

Loading…
Cancel
Save