diff --git a/test/e2e/tests/add-custom-network.spec.js b/test/e2e/tests/add-custom-network.spec.js index 9a20337cd..f93cccc1e 100644 --- a/test/e2e/tests/add-custom-network.spec.js +++ b/test/e2e/tests/add-custom-network.spec.js @@ -147,4 +147,55 @@ describe('Custom network', function () { }, ); }); + it('Add a custom network and then delete that same network', async function () { + await withFixtures( + { + fixtures: new FixtureBuilder() + .withPreferencesController({ + frequentRpcListDetail: [ + { + rpcUrl: networkURL, + chainId: chainID, + ticker: currencySYMBOL, + nickname: networkNAME, + rpcPrefs: {}, + }, + ], + }) + .build(), + 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); + + await driver.clickElement('.account-menu__icon'); + await driver.clickElement({ text: 'Settings', tag: 'div' }); + await driver.clickElement({ text: 'Networks', tag: 'div' }); + + const arbitrumNetwork = await driver.clickElement({ + text: `Arbitrum One`, + tag: 'div', + }); + + await driver.clickElement({ + tag: 'button', + text: 'Delete', + }); + + await driver.findElement('.modal-container__footer'); + // should be deleted from the modal shown again to complete deletion custom network + await driver.clickElement({ + tag: 'button', + text: 'Delete', + }); + + // it checks if custom network is delete + const existNetwork = await driver.isElementPresent(arbitrumNetwork); + assert.equal(existNetwork, false, 'Network is not deleted'); + }, + ); + }); });