From 70074c52c85b728e7d2ef7c623943ba76e8a8089 Mon Sep 17 00:00:00 2001 From: Marcelo Arias Date: Wed, 18 Jan 2023 17:20:47 -0500 Subject: [PATCH] Fix Notifications Overlay that opens automatically (#6133) * Show NotificationIndicator also if NotificationsList is shown * Create Notification Overlay Regression Test * Move notification regression test under notification.e2e.spec.js * Update selector of Notification Banner * Rename test to "Notification Overlay" --- e2e/tests/functional/notification.e2e.spec.js | 40 +++++++++++++++++++ .../components/NotificationIndicator.vue | 2 +- 2 files changed, 41 insertions(+), 1 deletion(-) diff --git a/e2e/tests/functional/notification.e2e.spec.js b/e2e/tests/functional/notification.e2e.spec.js index 39b7dd68a1..bc53196446 100644 --- a/e2e/tests/functional/notification.e2e.spec.js +++ b/e2e/tests/functional/notification.e2e.spec.js @@ -26,6 +26,7 @@ This test suite is dedicated to tests which verify Open MCT's Notification funct // FIXME: Remove this eslint exception once tests are implemented // eslint-disable-next-line no-unused-vars +const { createDomainObjectWithDefaults } = require('../../appActions'); const { test, expect } = require('../../pluginFixtures'); test.describe('Notifications List', () => { @@ -37,3 +38,42 @@ test.describe('Notifications List', () => { // Verify that the other notifications are still present in the notifications list }); }); + +test.describe('Notification Overlay', () => { + test('Closing notification list after notification banner disappeared does not cause it to open automatically', async ({ page }) => { + test.info().annotations.push({ + type: 'issue', + description: 'https://github.com/nasa/openmct/issues/6130' + }); + + // Go to baseURL + await page.goto('./', { waitUntil: 'networkidle' }); + + // Create a new Display Layout object + await createDomainObjectWithDefaults(page, { type: 'Display Layout' }); + + // Click on the button "Review 1 Notification" + await page.click('button[aria-label="Review 1 Notification"]'); + + // Verify that Notification List is open + expect(await page.locator('div[role="dialog"]').isVisible()).toBe(true); + + // Wait until there is no Notification Banner + await page.waitForSelector('div[role="alert"]', { state: 'detached'}); + + // Click on the "Close" button of the Notification List + await page.click('button[aria-label="Close"]'); + + // On the Display Layout object, click on the "Edit" button + await page.click('button[title="Edit"]'); + + // Click on the "Save" button + await page.click('button[title="Save"]'); + + // Click on the "Save and Finish Editing" option + await page.click('li[title="Save and Finish Editing"]'); + + // Verify that Notification List is NOT open + expect(await page.locator('div[role="dialog"]').isVisible()).toBe(false); + }); +}); diff --git a/src/plugins/notificationIndicator/components/NotificationIndicator.vue b/src/plugins/notificationIndicator/components/NotificationIndicator.vue index 416ee8d02f..921010a2d0 100644 --- a/src/plugins/notificationIndicator/components/NotificationIndicator.vue +++ b/src/plugins/notificationIndicator/components/NotificationIndicator.vue @@ -1,6 +1,6 @@