From 919367e1127ab30d6c769d921f6c30edba2d1be4 Mon Sep 17 00:00:00 2001 From: Waldemar Mazurek Date: Thu, 18 Jul 2024 10:14:52 +0200 Subject: [PATCH] Adds missing icon in alert (#3822) --- core/src/Alerts.svelte | 8 ++++++++ .../test2/1-angular/external-micro-frontend.cy.js | 3 +++ .../i18n-context-product-app-switcher.cy.js | 3 +++ .../luigi-client-link-manager-features.cy.js | 3 +++ .../1-angular/luigi-client-ux-alerts-i18n.cy.js | 12 ++++++++++++ .../cypress/e2e/tests/1-angular/navigation.cy.js | 3 +++ 6 files changed, 32 insertions(+) diff --git a/core/src/Alerts.svelte b/core/src/Alerts.svelte index a68292f6cd..1f4b812c06 100644 --- a/core/src/Alerts.svelte +++ b/core/src/Alerts.svelte @@ -108,6 +108,14 @@ id="j2ALl423" data-testid="luigi-alert" > +

{@html al.dataSanitized ? al.settings.text : ''}

diff --git a/test/e2e-test-application/cypress/e2e/test2/1-angular/external-micro-frontend.cy.js b/test/e2e-test-application/cypress/e2e/test2/1-angular/external-micro-frontend.cy.js index fd984e1b76..3378df9a02 100644 --- a/test/e2e-test-application/cypress/e2e/test2/1-angular/external-micro-frontend.cy.js +++ b/test/e2e-test-application/cypress/e2e/test2/1-angular/external-micro-frontend.cy.js @@ -7,6 +7,9 @@ describe('Navigation', () => { it('Check if external micro frontend is available and an alert will be shown.', () => { cy.visit('/projects/pr1/externalmf'); cy.get('[data-testid=luigi-alert]', { timeout: 5000 }).should('have.class', 'fd-message-strip--success'); + cy.get('[data-testid=luigi-alert]', { timeout: 5000 }) + .find('.fd-message-strip__icon-container span') + .should('have.class', 'sap-icon--message-success'); cy.get('[data-testid=luigi-alert]', { timeout: 5000 }).contains( 'This is just a test alert for external micro frontend.' ); diff --git a/test/e2e-test-application/cypress/e2e/tests/1-angular/i18n-context-product-app-switcher.cy.js b/test/e2e-test-application/cypress/e2e/tests/1-angular/i18n-context-product-app-switcher.cy.js index 747b5bfb0f..6d6b231790 100644 --- a/test/e2e-test-application/cypress/e2e/tests/1-angular/i18n-context-product-app-switcher.cy.js +++ b/test/e2e-test-application/cypress/e2e/tests/1-angular/i18n-context-product-app-switcher.cy.js @@ -42,6 +42,9 @@ describe('Context switcher', () => { .and('contain', 'Project 5'); cy.get('[data-testid=luigi-alert]').should('have.class', 'fd-message-strip--information'); + cy.get('[data-testid=luigi-alert]') + .find('.fd-message-strip__icon-container span') + .should('have.class', 'sap-icon--message-information'); cy.get('[data-testid=luigi-alert]').should('contain', 'Project 5 created.'); diff --git a/test/e2e-test-application/cypress/e2e/tests/1-angular/luigi-client-link-manager-features.cy.js b/test/e2e-test-application/cypress/e2e/tests/1-angular/luigi-client-link-manager-features.cy.js index 9590e5d6ba..a0bb650232 100644 --- a/test/e2e-test-application/cypress/e2e/tests/1-angular/luigi-client-link-manager-features.cy.js +++ b/test/e2e-test-application/cypress/e2e/tests/1-angular/luigi-client-link-manager-features.cy.js @@ -115,6 +115,9 @@ describe('Luigi client linkManager', () => { .eq(0) .click(); cy.get('[data-testid=luigi-alert]').should('have.class', 'fd-message-strip--information'); + cy.get('[data-testid=luigi-alert]') + .find('.fd-message-strip__icon-container span') + .should('have.class', 'sap-icon--message-information'); cy.get('[data-testid=luigi-alert]').should('contain', 'Hello from uxManager in Web Component, Language:en'); }); diff --git a/test/e2e-test-application/cypress/e2e/tests/1-angular/luigi-client-ux-alerts-i18n.cy.js b/test/e2e-test-application/cypress/e2e/tests/1-angular/luigi-client-ux-alerts-i18n.cy.js index 88dde25b3f..36e953a1e6 100644 --- a/test/e2e-test-application/cypress/e2e/tests/1-angular/luigi-client-ux-alerts-i18n.cy.js +++ b/test/e2e-test-application/cypress/e2e/tests/1-angular/luigi-client-ux-alerts-i18n.cy.js @@ -24,6 +24,9 @@ describe('Luigi Client UX Alerts + Localization', () => { .click(); cy.get('[data-testid=luigi-alert]').should('have.class', 'fd-message-strip--success'); + cy.get('[data-testid=luigi-alert]') + .find('.fd-message-strip__icon-container span') + .should('have.class', 'sap-icon--message-success'); cy.get('[data-testid=luigi-alert-dismiss]').click(); cy.get('[data-testid=luigi-alert]').should('not.exist'); @@ -39,6 +42,9 @@ describe('Luigi Client UX Alerts + Localization', () => { .click(); cy.get('[data-testid=luigi-alert]').should('have.class', 'fd-message-strip--information'); + cy.get('[data-testid=luigi-alert]') + .find('.fd-message-strip__icon-container span') + .should('have.class', 'sap-icon--message-information'); }); it('hides Alert after specified time', () => { @@ -133,6 +139,9 @@ describe('Luigi Client UX Alerts + Localization', () => { .click({ force: true }); cy.get('[data-testid=luigi-alert]').should('have.class', 'fd-message-strip--warning'); + cy.get('[data-testid=luigi-alert]') + .find('.fd-message-strip__icon-container span') + .should('have.class', 'sap-icon--message-warning'); cy.get('*[id$=_link_relativePath]').click(); cy.expectPathToBe('/projects/pr1'); @@ -171,6 +180,9 @@ describe('Luigi Client UX Alerts + Localization', () => { cy.get('[data-testid=luigi-alert]') .should('have.class', 'fd-message-strip--error') .should('contain', "click me!"); + cy.get('[data-testid=luigi-alert]') + .find('.fd-message-strip__icon-container span') + .should('have.class', 'sap-icon--message-error'); cy.get('[data-testid=luigi-alert]') .find('a') diff --git a/test/e2e-test-application/cypress/e2e/tests/1-angular/navigation.cy.js b/test/e2e-test-application/cypress/e2e/tests/1-angular/navigation.cy.js index ee00eddb8b..2823166c75 100644 --- a/test/e2e-test-application/cypress/e2e/tests/1-angular/navigation.cy.js +++ b/test/e2e-test-application/cypress/e2e/tests/1-angular/navigation.cy.js @@ -349,6 +349,9 @@ describe('Navigation', () => { cy.visit('/projects/pr2/emptyViewUrl'); cy.get('[data-testid=luigi-alert]').should('have.class', 'fd-message-strip--error'); + cy.get('[data-testid=luigi-alert]') + .find('.fd-message-strip__icon-container span') + .should('have.class', 'sap-icon--message-error'); cy.expectPathToBe('/overview'); }); });