@@ -368,11 +368,9 @@ describe('rc-tooltip', () => {
368368 const tooltipArrowElement = container . querySelector ( '.rc-tooltip-arrow' ) as HTMLElement ;
369369
370370 // Verify styles
371- expect ( tooltipElement . style . backgroundColor ) . toBe ( 'blue' ) ;
372- expect ( tooltipElement . style . zIndex ) . toBe ( '1000' ) ;
373- expect ( tooltipBodyElement . style . color ) . toBe ( 'red' ) ;
374- expect ( tooltipBodyElement . style . fontSize ) . toBe ( '14px' ) ;
375- expect ( tooltipArrowElement . style . borderColor ) . toBe ( 'green' ) ;
371+ expect ( tooltipElement ) . toHaveStyle ( { backgroundColor : 'blue' , zIndex : '1000' } ) ;
372+ expect ( tooltipBodyElement ) . toHaveStyle ( { color : 'red' , fontSize : '14px' } ) ;
373+ expect ( tooltipArrowElement ) . toHaveStyle ( { borderColor : 'green' } ) ;
376374 } ) ;
377375
378376 it ( 'should apply both classNames and styles simultaneously' , ( ) => {
@@ -406,11 +404,11 @@ describe('rc-tooltip', () => {
406404
407405 // Verify that classNames and styles work simultaneously
408406 expect ( tooltipElement ) . toHaveClass ( 'custom-root' ) ;
409- expect ( tooltipElement . style . backgroundColor ) . toBe ( 'blue' ) ;
407+ expect ( tooltipElement ) . toHaveStyle ( { backgroundColor : 'blue' } ) ;
410408 expect ( tooltipBodyElement ) . toHaveClass ( 'custom-body' ) ;
411- expect ( tooltipBodyElement . style . color ) . toBe ( 'red' ) ;
409+ expect ( tooltipBodyElement ) . toHaveStyle ( { color : 'red' } ) ;
412410 expect ( tooltipArrowElement ) . toHaveClass ( 'custom-arrow' ) ;
413- expect ( tooltipArrowElement . style . borderColor ) . toBe ( 'green' ) ;
411+ expect ( tooltipArrowElement ) . toHaveStyle ( { borderColor : 'green' } ) ;
414412 } ) ;
415413
416414 it ( 'should work with partial classNames and styles' , ( ) => {
@@ -439,7 +437,7 @@ describe('rc-tooltip', () => {
439437 const tooltipArrowElement = container . querySelector ( '.rc-tooltip-arrow' ) as HTMLElement ;
440438
441439 // Verify partial configuration takes effect
442- expect ( tooltipElement . style . backgroundColor ) . toBe ( 'blue' ) ;
440+ expect ( tooltipElement ) . toHaveStyle ( { backgroundColor : 'blue' } ) ;
443441 expect ( tooltipBodyElement ) . toHaveClass ( 'custom-body' ) ;
444442
445443 // Verify that unconfigured elements don't have custom class names or styles
@@ -481,9 +479,9 @@ describe('rc-tooltip', () => {
481479
482480 // Other styles still take effect
483481 expect ( tooltipElement ) . toHaveClass ( 'custom-root' ) ;
484- expect ( tooltipElement . style . backgroundColor ) . toBe ( 'blue' ) ;
482+ expect ( tooltipElement ) . toHaveStyle ( { backgroundColor : 'blue' } ) ;
485483 expect ( tooltipBodyElement ) . toHaveClass ( 'custom-body' ) ;
486- expect ( tooltipBodyElement . style . color ) . toBe ( 'red' ) ;
484+ expect ( tooltipBodyElement ) . toHaveStyle ( { color : 'red' } ) ;
487485 } ) ;
488486 } ) ;
489487
0 commit comments