File tree 3 files changed +18
-5
lines changed
3 files changed +18
-5
lines changed Original file line number Diff line number Diff line change 16
16
{{ #if showArrowDown }}
17
17
<button tabindex =" 0" class =" {{ classes.button }} " @click =" {{ _header.press }} " >
18
18
{{ #if interactiveLogo }}
19
- <img class =" ui5-shellbar-logo" src =" {{ logo }} " />
19
+ <img class =" ui5-shellbar-logo" src =" {{ logo }} " @ click = " {{ _logoPress }} " />
20
20
{{ /if }}
21
21
22
22
{{ #if primaryTitle }}
Original file line number Diff line number Diff line change 81
81
> </ ui5-shellbar >
82
82
83
83
< ui5-shellbar
84
+ id ="shellbarWithLogoClick "
84
85
class ="shellbar-example "
85
86
logo ="https://upload.wikimedia.org/wikipedia/commons/5/59/SAP_2011_logo.svg "
86
87
primary-title ="SAP Labs Bulgaria "
158
159
</ ui5-list >
159
160
</ ui5-popover >
160
161
161
- < ui5-input id ="press-input " style ="margin-top: 2rem; width: 240px; ">
162
-
163
- </ ui5-input >
162
+ < ui5-input id ="press-input " style ="margin-top: 2rem; "> </ ui5-input >
163
+ < ui5-input id ="press-input2 " style ="margin-top: 2rem; "> </ ui5-input >
164
164
165
165
< script >
166
166
shellbar . addEventListener ( "ui5-profileClick" , function ( event ) {
180
180
window [ "press-input" ] . value = "Logo"
181
181
} ) ;
182
182
183
+ shellbarWithLogoClick . addEventListener ( "ui5-logoClick" , function ( event ) {
184
+ window [ "press-input2" ] . value = shellbarWithLogoClick . primaryTitle . replace ( / \s / g, "" ) ;
185
+ } ) ;
186
+
183
187
shellbar . addEventListener ( "ui5-coPilotClick" , function ( event ) {
184
188
window [ "press-input" ] . value = "CoPilot"
185
189
} ) ;
Original file line number Diff line number Diff line change @@ -228,7 +228,7 @@ describe("Component Behavior", () => {
228
228
assert . strictEqual ( input . getValue ( ) , "Product Switch" , "Input value is set by click event of Product Switch icon" ) ;
229
229
} ) ;
230
230
231
- it ( "tests logoPress event" , ( ) => {
231
+ it ( "tests logoClick event" , ( ) => {
232
232
const logo = browser . $ ( "#shellbar" ) . shadow$ ( ".ui5-shellbar-logo" ) ;
233
233
const input = browser . $ ( "#press-input" ) ;
234
234
@@ -283,6 +283,15 @@ describe("Component Behavior", () => {
283
283
browser . setWindowSize ( 510 , 1080 ) ;
284
284
} ) ;
285
285
286
+ it ( "tests logoClick event" , ( ) => {
287
+ const logo = browser . $ ( "#shellbarWithLogoClick" ) . shadow$ ( ".ui5-shellbar-logo" ) ;
288
+ const title = "SAPLabsBulgaria" ;
289
+ const input = browser . $ ( "#press-input2" ) ;
290
+
291
+ logo . click ( ) ;
292
+ assert . strictEqual ( input . getValue ( ) , title , "Input value is set by click event of Logo" ) ;
293
+ } ) ;
294
+
286
295
it ( "tests opening of menu" , ( ) => {
287
296
const primaryTitle = browser . $ ( "#shellbar" ) . shadow$ ( ".ui5-shellbar-menu-button" ) ;
288
297
const staticAreaItemClassName = browser . getStaticAreaItemClassName ( "#shellbar" )
You can’t perform that action at this time.
0 commit comments