@@ -321,6 +321,37 @@ describe("Responsiveness", () => {
321
321
} ) ;
322
322
323
323
describe ( "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
+
324
355
describe ( "Content slot" , ( ) => {
325
356
it ( "Test separators visibility" , ( ) => {
326
357
function assertStartSeparatorVisibility ( expectedExist : boolean ) {
@@ -763,7 +794,7 @@ describe("Events", () => {
763
794
cy . get ( "@shellbar" )
764
795
. shadow ( )
765
796
. find ( "[data-profile-btn]" )
766
- . click ( ) ;
797
+ . click ( { force : true } ) ;
767
798
768
799
cy . get ( "@profileClick" )
769
800
. should ( "have.been.calledOnce" ) ;
@@ -985,7 +1016,7 @@ describe("Events", () => {
985
1016
cy . get ( "@shellbar" )
986
1017
. shadow ( )
987
1018
. find ( "[data-profile-btn]" )
988
- . click ( ) ;
1019
+ . click ( { force : true } ) ;
989
1020
990
1021
cy . get ( "@profileClick" )
991
1022
. should ( "have.been.calledOnce" ) ;
0 commit comments