@@ -1134,6 +1134,27 @@ describe('IgxTooltip', () => {
11341134 verifyTooltipVisibility ( tooltipNativeElement , tooltipTarget , true ) ;
11351135 expect ( tooltipNativeElement . getAttribute ( 'role' ) ) . toBe ( 'status' ) ;
11361136 } ) ;
1137+
1138+ it ( 'should correctly remove the close button and update the role when sticky is set to false' , async ( ) => {
1139+ tooltipTarget . sticky = true ;
1140+ fix . detectChanges ( ) ;
1141+ hoverElement ( button ) ;
1142+ await wait ( SHOW_DELAY + 50 ) ;
1143+ fix . detectChanges ( ) ;
1144+
1145+ const closeBtn = tooltipNativeElement . querySelector ( 'igx-tooltip-close-button' ) ;
1146+ expect ( closeBtn ) . not . toBeNull ( ) ;
1147+ expect ( fix . componentInstance . tooltip . role ) . toBe ( 'status' ) ;
1148+
1149+ tooltipTarget . sticky = false ;
1150+ fix . detectChanges ( ) ;
1151+ hoverElement ( button ) ;
1152+ await wait ( SHOW_DELAY + 50 ) ;
1153+ fix . detectChanges ( ) ;
1154+
1155+ expect ( fix . componentInstance . tooltip . role ) . toBe ( 'tooltip' ) ;
1156+ expect ( tooltipNativeElement . querySelector ( 'igx-tooltip-close-button' ) ) . toBeNull ( ) ;
1157+ } ) ;
11371158 } ) ;
11381159 } ) ;
11391160
@@ -1222,7 +1243,7 @@ const alignmentTolerance = 2;
12221243export const verifyTooltipPosition = (
12231244 tooltipNativeElement : HTMLElement ,
12241245 actualTarget : { nativeElement : HTMLElement } ,
1225- shouldAlign :boolean = true ,
1246+ shouldAlign : boolean = true ,
12261247 placement : Placement = Placement . Bottom ,
12271248 offset : number = 6
12281249) => {
0 commit comments