From 56b157f6926960d624941713b758e6a0b3af6449 Mon Sep 17 00:00:00 2001 From: Mark Stacey Date: Tue, 2 Jun 2020 18:47:55 -0300 Subject: [PATCH] Fix hide token e2e test (#8724) The e2e test for the "Hide token" functionality was incorrectly clicking "Cancel" on the "Hide token" modal, thus not actually testing that that token was hidden at all. The "Confirm" button is now selected using a test id, to ensure the wrong button isn't selected. --- test/e2e/metamask-ui.spec.js | 4 +--- ui/app/components/app/modals/hide-token-confirmation-modal.js | 2 ++ 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/test/e2e/metamask-ui.spec.js b/test/e2e/metamask-ui.spec.js index 6cb3981cb..ecee19cee 100644 --- a/test/e2e/metamask-ui.spec.js +++ b/test/e2e/metamask-ui.spec.js @@ -1223,8 +1223,7 @@ describe('MetaMask', function () { const confirmHideModal = await driver.findElement(By.css('span .modal')) - const byHideTokenConfirmationButton = By.css('.hide-token-confirmation__button') - await driver.clickElement(byHideTokenConfirmationButton) + await driver.clickElement(By.css('[data-testid="hide-token-confirmation__hide"]')) await driver.wait(until.stalenessOf(confirmHideModal)) }) @@ -1232,7 +1231,6 @@ describe('MetaMask', function () { describe('Add existing token using search', function () { it('clicks on the Add Token button', async function () { - await driver.clickElement(By.css('[data-testid="asset__back"]')) await driver.clickElement(By.xpath(`//button[contains(text(), 'Add Token')]`)) await driver.delay(regularDelayMs) }) diff --git a/ui/app/components/app/modals/hide-token-confirmation-modal.js b/ui/app/components/app/modals/hide-token-confirmation-modal.js index fdd452b35..5f8e6001a 100644 --- a/ui/app/components/app/modals/hide-token-confirmation-modal.js +++ b/ui/app/components/app/modals/hide-token-confirmation-modal.js @@ -65,12 +65,14 @@ class HideTokenConfirmationModal extends Component {