From db20399d817e3f19fe0e83004c4f1deffd70df16 Mon Sep 17 00:00:00 2001 From: Dan J Miller Date: Mon, 1 Nov 2021 08:16:05 -0230 Subject: [PATCH] Turn off all old notifications (#12500) * Turn off all old notifications * Remove unnecessary attempt to close whats new popup in e2e test * Remove unneeded whats new popup closes in e2e tests * Lint fix --- test/e2e/metamask-ui.spec.js | 18 ------------------ test/e2e/tests/add-hide-token.spec.js | 2 -- test/e2e/tests/from-import-ui.spec.js | 5 ----- test/e2e/tests/incremental-security.spec.js | 7 ------- ui/selectors/selectors.js | 20 ++++++++------------ 5 files changed, 8 insertions(+), 44 deletions(-) diff --git a/test/e2e/metamask-ui.spec.js b/test/e2e/metamask-ui.spec.js index 3f57d00ae..f12b8a090 100644 --- a/test/e2e/metamask-ui.spec.js +++ b/test/e2e/metamask-ui.spec.js @@ -176,24 +176,6 @@ describe('MetaMask', function () { }); }); - describe("Close the what's new popup", function () { - it("should show the what's new popover", async function () { - const popoverTitle = await driver.findElement( - '.popover-header__title h2', - ); - - assert.equal(await popoverTitle.getText(), "What's new"); - }); - - it("should close the what's new popup", async function () { - const popover = await driver.findElement('.popover-container'); - - await driver.clickElement('[data-testid="popover-close"]'); - - await popover.waitForElementState('hidden'); - }); - }); - describe('Import Secret Recovery Phrase', function () { it('logs out of the vault', async function () { await driver.clickElement('.account-menu__icon'); diff --git a/test/e2e/tests/add-hide-token.spec.js b/test/e2e/tests/add-hide-token.spec.js index fa5e85009..66c6067bb 100644 --- a/test/e2e/tests/add-hide-token.spec.js +++ b/test/e2e/tests/add-hide-token.spec.js @@ -27,7 +27,6 @@ describe('Hide token', function () { css: '.asset-list-item__token-button', text: '0 TST', }); - await driver.clickElement('.popover-header__button'); let assets = await driver.findElements('.asset-list-item'); assert.equal(assets.length, 2); @@ -39,7 +38,6 @@ describe('Hide token', function () { await driver.clickElement('[data-testid="asset-options__button"]'); await driver.clickElement('[data-testid="asset-options__hide"]'); - // wait for confirm hide modal to be visible const confirmHideModal = await driver.findVisibleElement('span .modal'); diff --git a/test/e2e/tests/from-import-ui.spec.js b/test/e2e/tests/from-import-ui.spec.js index ad97bb257..0bd3b683a 100644 --- a/test/e2e/tests/from-import-ui.spec.js +++ b/test/e2e/tests/from-import-ui.spec.js @@ -60,11 +60,6 @@ describe('Metamask Import UI', function () { tag: 'button', }); - // close the what's new popup - const popover = await driver.findElement('.popover-container'); - await driver.clickElement('[data-testid="popover-close"]'); - await popover.waitForElementState('hidden'); - // Show account information await driver.clickElement( '[data-testid="account-options-menu-button"]', diff --git a/test/e2e/tests/incremental-security.spec.js b/test/e2e/tests/incremental-security.spec.js index e000e9817..90df69560 100644 --- a/test/e2e/tests/incremental-security.spec.js +++ b/test/e2e/tests/incremental-security.spec.js @@ -65,13 +65,6 @@ describe('Incremental Security', function () { tag: 'button', }); - // closes the what's new popup - const popover = await driver.findElement('.popover-container'); - - await driver.clickElement('[data-testid="popover-close"]'); - - await popover.waitForElementState('hidden'); - await driver.clickElement( '[data-testid="account-options-menu-button"]', ); diff --git a/ui/selectors/selectors.js b/ui/selectors/selectors.js index cfbd8e246..dec951328 100644 --- a/ui/selectors/selectors.js +++ b/ui/selectors/selectors.js @@ -2,7 +2,6 @@ import { createSelector } from 'reselect'; import { addHexPrefix } from '../../app/scripts/lib/util'; import { MAINNET_CHAIN_ID, - BSC_CHAIN_ID, TEST_CHAINS, NETWORK_TYPE_RPC, NATIVE_CURRENCY_TOKEN_IMAGE_MAP, @@ -576,18 +575,15 @@ export function getShowWhatsNewPopup(state) { * @param {Object} state * @returns {Object} */ -function getAllowedNotificationIds(state) { - const currentKeyring = getCurrentKeyring(state); - const currentKeyringIsLedger = currentKeyring?.type === KEYRING_TYPES.LEDGER; - +function getAllowedNotificationIds() { return { - 1: true, - 2: true, - 3: true, - 4: getCurrentChainId(state) === BSC_CHAIN_ID, - 5: true, - 6: currentKeyringIsLedger, - 7: currentKeyringIsLedger, + 1: false, + 2: false, + 3: false, + 4: false, + 5: false, + 6: false, + 7: false, }; }