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"
This commit is contained in:
Marcelo Arias 2023-01-18 17:20:47 -05:00 committed by GitHub
parent d5adaf6e8c
commit 70074c52c8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 41 additions and 1 deletions

View File

@ -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 // FIXME: Remove this eslint exception once tests are implemented
// eslint-disable-next-line no-unused-vars // eslint-disable-next-line no-unused-vars
const { createDomainObjectWithDefaults } = require('../../appActions');
const { test, expect } = require('../../pluginFixtures'); const { test, expect } = require('../../pluginFixtures');
test.describe('Notifications List', () => { test.describe('Notifications List', () => {
@ -37,3 +38,42 @@ test.describe('Notifications List', () => {
// Verify that the other notifications are still present in the 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);
});
});

View File

@ -1,6 +1,6 @@
<template> <template>
<div <div
v-if="notifications.length > 0" v-if="notifications.length === 0 ? showNotificationsOverlay : notifications.length > 0"
class="c-indicator c-indicator--clickable icon-bell" class="c-indicator c-indicator--clickable icon-bell"
:class="[severityClass]" :class="[severityClass]"
> >