File tree 1 file changed +4
-7
lines changed
1 file changed +4
-7
lines changed Original file line number Diff line number Diff line change @@ -268,18 +268,15 @@ describe('rc-tooltip', () => {
268
268
</ Tooltip > ,
269
269
) ;
270
270
271
- const tooltipElement = container . querySelector ( '.rc-tooltip' ) ;
272
- const tooltipInnerElement = container . querySelector ( '.rc-tooltip-inner' ) ;
271
+ const tooltipElement = container . querySelector ( '.rc-tooltip' ) as HTMLElement ;
272
+ const tooltipInnerElement = container . querySelector ( '.rc-tooltip-inner' ) as HTMLElement ;
273
273
274
274
// 验证 classNames
275
275
expect ( tooltipElement . classList ) . toContain ( 'custom-root' ) ;
276
276
expect ( tooltipInnerElement . classList ) . toContain ( 'custom-inner' ) ;
277
277
278
278
// 验证 styles
279
- const tooltipElementStyle = getComputedStyle ( tooltipElement ) ;
280
- const tooltipInnerElementStyle = getComputedStyle ( tooltipInnerElement ) ;
281
-
282
- expect ( tooltipElementStyle . backgroundColor ) . toBe ( 'blue' ) ;
283
- expect ( tooltipInnerElementStyle . color ) . toBe ( 'red' ) ;
279
+ expect ( tooltipElement . style . backgroundColor ) . toBe ( 'blue' ) ;
280
+ expect ( tooltipInnerElement . style . color ) . toBe ( 'red' ) ;
284
281
} ) ;
285
282
} ) ;
You can’t perform that action at this time.
0 commit comments