Skip to content

Commit

Permalink
fix(ui5-shellbar): primary title menu is closed on content click (#3032)
Browse files Browse the repository at this point in the history
  • Loading branch information
dobrinyonkov authored and ilhan007 committed Mar 30, 2021
1 parent b74eee9 commit 1f8de4a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/fiori/src/ShellBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -464,6 +464,7 @@ class ShellBar extends UI5Element {
}

_menuItemPress(event) {
this.menuPopover.close();
this.fireEvent("menu-item-click", {
item: event.detail.item,
}, true);
Expand Down
17 changes: 17 additions & 0 deletions packages/fiori/test/specs/ShellBar.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,22 @@ describe("Component Behavior", () => {
browser.url(`http://localhost:${PORT}/test-resources/pages/ShellBar.html`);
});


describe("ui5-shellbar menu", () => {
it("tests close on content click", () => {
const primaryTitle = browser.$("#shellbar").shadow$(".ui5-shellbar-menu-button");
const staticAreaItemClassName = browser.getStaticAreaItemClassName("#shellbar")
const menuPopover = browser.$(`.${staticAreaItemClassName}`).shadow$(".ui5-shellbar-menu-popover");
const firstMenuItem = menuPopover.$("ui5-list > ui5-li");

primaryTitle.click();
firstMenuItem.click();

assert.strictEqual(menuPopover.getProperty("opened"), false, "Count property propagates to ui5-button");
});
});


describe("ui5-shellbar-item", () => {
it("tests count property", () => {
const shellbar = browser.$("#shellbarwithitems");
Expand Down Expand Up @@ -300,6 +316,7 @@ describe("Component Behavior", () => {
assert.strictEqual(input.getValue(), "Application 1", "Input value is set by click event of the first menu item");
assert.strictEqual(inputData.getValue(), "key1", "The user defined attributes are available.");

primaryTitle.click();
secondMenuItem.click();

assert.strictEqual(input.getValue(), "Application 2", "Input value is set by click event of the second menu item");
Expand Down

0 comments on commit 1f8de4a

Please sign in to comment.