@@ -321,6 +321,37 @@ describe("Responsiveness", () => {
321321} ) ;
322322
323323describe ( "Slots" , ( ) => {
324+ describe ( "Profile slot" , ( ) => {
325+ it ( "forwards click from shellbar profile button to slotted avatar (mount pattern)" , ( ) => {
326+ const clickSpy = cy . spy ( ) . as ( "avatarClickSpy" ) ;
327+ const profileClickSpy = cy . spy ( ) . as ( "profileClickSpy" ) ;
328+
329+ cy . mount (
330+ < div >
331+ < ShellBar id = "test-shellbar" >
332+ < Avatar
333+ id = "test-avatar"
334+ slot = "profile"
335+ interactive
336+ initials = "XY"
337+ />
338+ </ ShellBar >
339+ </ div >
340+ ) ;
341+
342+ cy . get ( "#test-avatar" ) . then ( $el => {
343+ $el [ 0 ] . addEventListener ( "ui5-click" , clickSpy ) ;
344+ } ) ;
345+ cy . get ( "#test-shellbar" ) . then ( $el => {
346+ $el [ 0 ] . addEventListener ( "ui5-profile-click" , profileClickSpy ) ;
347+ } ) ;
348+
349+ cy . get ( "#test-shellbar" ) . shadow ( ) . find ( ".ui5-shellbar-image-button" ) . realClick ( ) ;
350+ cy . get ( "@profileClickSpy" ) . should ( "have.been.calledOnce" ) ;
351+ cy . get ( "@avatarClickSpy" ) . should ( "have.been.calledOnce" ) ;
352+ } ) ;
353+ } ) ;
354+
324355 describe ( "Content slot" , ( ) => {
325356 it ( "Test separators visibility" , ( ) => {
326357 function assertStartSeparatorVisibility ( expectedExist : boolean ) {
@@ -763,7 +794,7 @@ describe("Events", () => {
763794 cy . get ( "@shellbar" )
764795 . shadow ( )
765796 . find ( "[data-profile-btn]" )
766- . click ( ) ;
797+ . click ( { force : true } ) ;
767798
768799 cy . get ( "@profileClick" )
769800 . should ( "have.been.calledOnce" ) ;
@@ -985,7 +1016,7 @@ describe("Events", () => {
9851016 cy . get ( "@shellbar" )
9861017 . shadow ( )
9871018 . find ( "[data-profile-btn]" )
988- . click ( ) ;
1019+ . click ( { force : true } ) ;
9891020
9901021 cy . get ( "@profileClick" )
9911022 . should ( "have.been.calledOnce" ) ;
0 commit comments