File tree Expand file tree Collapse file tree 1 file changed +4
-7
lines changed
Expand file tree Collapse file tree 1 file changed +4
-7
lines changed Original file line number Diff line number Diff line change @@ -268,18 +268,15 @@ describe('rc-tooltip', () => {
268268 </ Tooltip > ,
269269 ) ;
270270
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 ;
273273
274274 // 验证 classNames
275275 expect ( tooltipElement . classList ) . toContain ( 'custom-root' ) ;
276276 expect ( tooltipInnerElement . classList ) . toContain ( 'custom-inner' ) ;
277277
278278 // 验证 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' ) ;
284281 } ) ;
285282} ) ;
You can’t perform that action at this time.
0 commit comments