Skip to content

Commit

Permalink
iconClassAttribute for sap-icons (#4102)
Browse files Browse the repository at this point in the history
* iconClassAttribute for sap-icons

* add cypress tests for iconClassAttribute

---------

Co-authored-by: Waldemar Mazurek <[email protected]>
Co-authored-by: Vincent Öller <[email protected]>
  • Loading branch information
3 people authored Jan 15, 2025
1 parent 3b26d91 commit 8890887
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 3 deletions.
2 changes: 1 addition & 1 deletion core/src/UserSettingsDialog.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@
<a tabindex="-1" class="fd-list__link" href="#">
{#if userSettingsGroupProperty[1].icon}
{#if hasOpenUIicon(userSettingsGroupProperty[1])}
<span class="fd-list__thumbnail">
<span class="fd-list__thumbnail {userSettingsGroupProperty[1].iconClassAttribute || ''}">
<i role="presentation" class={getSapIconStr(userSettingsGroupProperty[1].icon)} />
</span>
{:else}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ describe('Navigation', () => {
//Check Dialog is open
cy.get('.lui-usersettings-dialog').should('exist');

//Check we have 5 left bar items
//Check we have 6 left bar items
cy.get('.lui-us-list')
.find('[data-testid="us-navigation-item"]')
.should('have.length', 6);
Expand Down Expand Up @@ -39,6 +39,28 @@ describe('Navigation', () => {
openSettingsDialogBox();
});

it('check iconClassAttribute', () => {
cy.get('[data-testid="us-navigation-item"]')
.eq(0) // User Account
.get('span')
.should('have.class', 'fd-avatar fd-avatar--s fd-avatar--circle fd-avatar--thumbnail lui-avatar-space');

cy.get('[data-testid="us-navigation-item"]')
.eq(1) // Language & Region
.get('span')
.should('have.class', 'fd-image--s fd-list__thumbnail'); // default value, no iconClassAttribute specified

cy.get('[data-testid="us-navigation-item"]')
.eq(2) // Privacy
.get('span')
.should('have.class', 'SAP-icon-iconClassAttribute-Test');

cy.get('[data-testid="us-navigation-item"]')
.eq(3) // Theming
.get('span')
.should('have.class', 'fd-list__thumbnail'); // default value, no iconClassAttribute specified
});

describe('User Account Configuration', () => {
const setting_name = 'name_' + new Date().getTime();
const setting_date_format = 'df_' + new Date().getTime();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ class UserSettings {
label: 'Privacy',
title: 'Privacy',
icon: 'private',
iconClassAttribute: 'SAP-icon-iconClassAttribute-Test',
settings: {
policy: {
type: 'string',
Expand All @@ -88,7 +89,7 @@ class UserSettings {
theming: {
label: 'Theming',
title: 'Theming',
icon: 'private',
icon: 'palette',
viewUrl: 'http://localhost:8090/customUserSettingsMf.html',
settings: {
theme: {
Expand Down

0 comments on commit 8890887

Please sign in to comment.