File tree Expand file tree Collapse file tree 2 files changed +18
-0
lines changed
Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -464,6 +464,7 @@ class ShellBar extends UI5Element {
464464 }
465465
466466 _menuItemPress ( event ) {
467+ this . menuPopover . close ( ) ;
467468 this . fireEvent ( "menu-item-click" , {
468469 item : event . detail . item ,
469470 } , true ) ;
Original file line number Diff line number Diff line change @@ -28,6 +28,22 @@ describe("Component Behavior", () => {
2828 browser . url ( `http://localhost:${ PORT } /test-resources/pages/ShellBar.html` ) ;
2929 } ) ;
3030
31+
32+ describe ( "ui5-shellbar menu" , ( ) => {
33+ it ( "tests close on content click" , ( ) => {
34+ const primaryTitle = browser . $ ( "#shellbar" ) . shadow$ ( ".ui5-shellbar-menu-button" ) ;
35+ const staticAreaItemClassName = browser . getStaticAreaItemClassName ( "#shellbar" )
36+ const menuPopover = browser . $ ( `.${ staticAreaItemClassName } ` ) . shadow$ ( ".ui5-shellbar-menu-popover" ) ;
37+ const firstMenuItem = menuPopover . $ ( "ui5-list > ui5-li" ) ;
38+
39+ primaryTitle . click ( ) ;
40+ firstMenuItem . click ( ) ;
41+
42+ assert . strictEqual ( menuPopover . getProperty ( "opened" ) , false , "Count property propagates to ui5-button" ) ;
43+ } ) ;
44+ } ) ;
45+
46+
3147 describe ( "ui5-shellbar-item" , ( ) => {
3248 it ( "tests count property" , ( ) => {
3349 const shellbar = browser . $ ( "#shellbarwithitems" ) ;
@@ -300,6 +316,7 @@ describe("Component Behavior", () => {
300316 assert . strictEqual ( input . getValue ( ) , "Application 1" , "Input value is set by click event of the first menu item" ) ;
301317 assert . strictEqual ( inputData . getValue ( ) , "key1" , "The user defined attributes are available." ) ;
302318
319+ primaryTitle . click ( ) ;
303320 secondMenuItem . click ( ) ;
304321
305322 assert . strictEqual ( input . getValue ( ) , "Application 2" , "Input value is set by click event of the second menu item" ) ;
You can’t perform that action at this time.
0 commit comments