File tree Expand file tree Collapse file tree 3 files changed +588
-4
lines changed Expand file tree Collapse file tree 3 files changed +588
-4
lines changed Original file line number Diff line number Diff line change @@ -1071,3 +1071,70 @@ IntegrationActionGroup.parameters = {
10711071 } ,
10721072 } ,
10731073} ;
1074+
1075+ // ====================
1076+ // TEST HELPERS
1077+ // ====================
1078+ // Legacy exports for test compatibility
1079+
1080+ export const click = ( args : Properties ) : TemplateResult => Template ( args ) ;
1081+ click . args = {
1082+ interaction : 'click' ,
1083+ placement : 'right' ,
1084+ style : 'container-type' as WrapperStyleType ,
1085+ type : 'auto' ,
1086+ } ;
1087+
1088+ export const receivesFocus = ( {
1089+ interaction,
1090+ open,
1091+ placement,
1092+ receivesFocus,
1093+ type,
1094+ } : Properties & { receivesFocus ?: string } ) : TemplateResult => html `
1095+ < sp-action-button id ="trigger ">
1096+ Open the overlay (with focus)
1097+ </ sp-action-button >
1098+ < sp-overlay
1099+ ?open =${ open }
1100+ trigger ="trigger@${ interaction } "
1101+ type=${ ifDefined ( type ) }
1102+ placement=${ ifDefined ( placement ) }
1103+ .receivesFocus=${ receivesFocus }
1104+ >
1105+ < sp-popover >
1106+ < sp-dialog size ="s " no-divider >
1107+ < a href ="https://example.com "> Click Content</ a >
1108+ </ sp-dialog >
1109+ </ sp-popover >
1110+ </ sp-overlay >
1111+ ` ;
1112+ receivesFocus . args = {
1113+ interaction : 'click' ,
1114+ placement : 'bottom-start' ,
1115+ type : 'auto' ,
1116+ receivesFocus : 'true' ,
1117+ } as Properties & { receivesFocus ?: string } ;
1118+
1119+ export const withSlider = ( ) : TemplateResult => html `
1120+ < sp-button id ="triggerEl " variant ="primary "> Button popover</ sp-button >
1121+ < sp-overlay trigger ="triggerEl@click " placement ="bottom ">
1122+ < sp-popover tip >
1123+ < sp-dialog no-divider class ="options-popover-content ">
1124+ < p > Try clicking the slider after popover opens</ p >
1125+ < p > It shouldn't close the popover</ p >
1126+ < sp-slider
1127+ value ="5 "
1128+ step ="0.5 "
1129+ min ="0 "
1130+ max ="20 "
1131+ label ="Awesomeness "
1132+ > </ sp-slider >
1133+ < sp-button > Press me</ sp-button >
1134+ </ sp-dialog >
1135+ </ sp-popover >
1136+ </ sp-overlay >
1137+ ` ;
1138+ withSlider . swc_vrt = {
1139+ skip : true ,
1140+ } ;
You can’t perform that action at this time.
0 commit comments