Skip to content

Commit

Permalink
Adds missing icon in alert (#3822)
Browse files Browse the repository at this point in the history
  • Loading branch information
walmazacn authored Jul 18, 2024
1 parent 42c9d0d commit 919367e
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 0 deletions.
8 changes: 8 additions & 0 deletions core/src/Alerts.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,14 @@
id="j2ALl423"
data-testid="luigi-alert"
>
<div class="fd-message-strip__icon-container" aria-hidden="true">
<span
class="sap-icon sap-icon--message-{alertTypeMap[al.settings.type]}"
focusable="false"
role="presentation"
aria-hidden="true"
/>
</div>
<p class="fd-message-strip__text">
{@html al.dataSanitized ? al.settings.text : ''}
</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.'
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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');
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand All @@ -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', () => {
Expand Down Expand Up @@ -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');
Expand Down Expand Up @@ -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', "<b onmouseover=alert('Wufff!')>click me!</b>");
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')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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');
});
});
Expand Down

0 comments on commit 919367e

Please sign in to comment.