Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds missing icon in alert #3822

Merged
merged 5 commits into from
Jul 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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