@@ -3,13 +3,12 @@ import { TooltipContent } from "./tooltipContent";
3
3
describe ( "TooltipContent" , ( ) => {
4
4
it ( "renders plain text when tooltipRenderAsHtml is false" , ( ) => {
5
5
const el = TooltipContent ( {
6
- text : "Hello, tooltip! " ,
6
+ text : "<strong>Bold Text</strong> " ,
7
7
tooltipRenderAsHtml : false ,
8
8
} ) ;
9
9
10
- expect ( el . textContent ) . toBe ( "Hello, tooltip!" ) ;
11
- expect ( el . innerHTML ) . toBe ( "Hello, tooltip!" ) ;
12
- expect ( el . className ) . toBe ( "introjs-tooltiptext" ) ;
10
+ expect ( el . innerHTML ) . toBe ( "<strong>Bold Text</strong>" ) ;
11
+ expect ( el . querySelector ( "strong" ) ) . toBeNull ( ) ;
13
12
} ) ;
14
13
15
14
it ( "renders HTML content when tooltipRenderAsHtml is true" , ( ) => {
@@ -31,20 +30,4 @@ describe("TooltipContent", () => {
31
30
expect ( el . className ) . toBe ( "my-custom-tooltip" ) ;
32
31
expect ( el . textContent ) . toBe ( "Custom class test" ) ;
33
32
} ) ;
34
-
35
- it ( "clears old content on re-derivation" , ( ) => {
36
- const el = TooltipContent ( {
37
- text : "<i>Initial</i>" ,
38
- tooltipRenderAsHtml : true ,
39
- } ) ;
40
-
41
- el . innerHTML = "<b>Old Content</b>" ; // Simulate old content
42
- const updated = TooltipContent ( {
43
- text : "Updated text" ,
44
- tooltipRenderAsHtml : false ,
45
- } ) ;
46
-
47
- expect ( updated . innerHTML ) . toBe ( "Updated text" ) ;
48
- expect ( updated . querySelector ( "b" ) ) . toBeNull ( ) ;
49
- } ) ;
50
33
} ) ;
0 commit comments