mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
add test: Import Account using private key of an already active account should result in an error (#13673)
This commit is contained in:
parent
6dd141ebfd
commit
7af75e13a2
@ -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…
x
Reference in New Issue
Block a user