-
Notifications
You must be signed in to change notification settings - Fork 273
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ui5-user-menu): introduce
show-edit-button
property (#10619)
* feat(ui5-user-menu): add a property to hide avatar icon for editing
- Loading branch information
1 parent
600ab25
commit 6adec46
Showing
5 changed files
with
42 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -169,6 +169,7 @@ describe("Avatar configuration", () => { | |
cy.get("@avatar").should("exist"); | ||
cy.get("@avatar").should("have.length", 1); | ||
cy.get("@avatar").should("have.attr", "fallback-icon", "person-placeholder"); | ||
cy.get("@avatar").find("[ui5-tag]").should("not.exist"); | ||
}); | ||
|
||
it("tests initials", () => { | ||
|
@@ -208,6 +209,25 @@ describe("Avatar configuration", () => { | |
cy.get("@image").should("have.length", 1); | ||
cy.get("@image").should("have.attr", "src", "./../../test/pages/img/man_avatar_1.png"); | ||
}); | ||
|
||
it("tests showEditButton", () => { | ||
cy.mount(html`<ui5-button id="openUserMenuBtn">Open User Menu</ui5-button> | ||
<ui5-user-menu open opener="openUserMenuBtn" show-edit-button> | ||
<ui5-user-menu-account slot="accounts" | ||
title-text="Alain Chevalier 1" | ||
subtitle-text="[email protected]" | ||
description="Delivery Manager, SAP SE"> | ||
</ui5-user-menu-account> | ||
</ui5-user-menu>`); | ||
cy.get("[ui5-user-menu]").as("userMenu"); | ||
cy.get("@userMenu").should("exist"); | ||
cy.get("@userMenu").shadow().find("[ui5-avatar]").as("avatar"); | ||
cy.get("@avatar").should("exist"); | ||
cy.get("@avatar").should("have.length", 1); | ||
cy.get("@avatar").should("have.attr", "fallback-icon", "person-placeholder"); | ||
cy.get("@avatar").find("[ui5-tag]").should("exist"); | ||
cy.get("@avatar").find("[ui5-tag]").should("have.length", 1); | ||
}); | ||
}); | ||
|
||
describe("Events", () => { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters