-
Notifications
You must be signed in to change notification settings - Fork 270
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): add open and close events (#10363)
* feat(ui5-user-menu): provide open and close events * feat(ui5-user-menu): provide open and close events * chore(ui5-user-menu): fix lint error * chore(ui5-user-menu): add documentation * chore: fix review comments --------- Co-authored-by: Adrian Bobev <[email protected]>
- Loading branch information
1 parent
63ceea3
commit 8109bfd
Showing
6 changed files
with
119 additions
and
5 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
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
29 changes: 29 additions & 0 deletions
29
packages/fiori/cypress/support/commands/UserMenu.commands.ts
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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
Cypress.Commands.add("ui5UserMenuOpen", { prevSubject: true }, (prevSubject, options) => { | ||
cy.wrap(prevSubject) | ||
.as("userMenu") | ||
.then($userMenu => { | ||
if (options?.opener) { | ||
cy.wrap($userMenu) | ||
.invoke("attr", "opener", options.opener); | ||
} | ||
|
||
cy.wrap($userMenu) | ||
.invoke("attr", "open", true); | ||
}); | ||
|
||
cy.get("@userMenu") | ||
.ui5UserMenuOpened(); | ||
}); | ||
|
||
Cypress.Commands.add("ui5UserMenuOpened", { prevSubject: true }, subject => { | ||
cy.wrap(subject) | ||
.as("userMenu"); | ||
|
||
cy.get("@userMenu") | ||
.should("have.attr", "open"); | ||
|
||
cy.get("@userMenu") | ||
.shadow() | ||
.find("[ui5-responsive-popover]") | ||
.should("have.attr", "open"); | ||
}); |
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