@@ -502,36 +502,6 @@ describe('rc-tooltip', () => {
502502 } ) ;
503503
504504 describe ( 'children handling' , ( ) => {
505- it ( 'should toggle aria-describedby with visibility' , async ( ) => {
506- const { container } = render (
507- < Tooltip trigger = { [ 'click' ] } overlay = "tooltip content" >
508- < button > Click me</ button >
509- </ Tooltip > ,
510- ) ;
511-
512- const btn = container . querySelector ( 'button' ) ;
513- expect ( btn ) . not . toHaveAttribute ( 'aria-describedby' ) ;
514-
515- fireEvent . click ( btn ) ;
516- await waitFakeTimers ( ) ;
517- const describedby = btn . getAttribute ( 'aria-describedby' ) ;
518- expect ( describedby ) . toBeTruthy ( ) ;
519-
520- fireEvent . click ( btn ) ;
521- await waitFakeTimers ( ) ;
522- expect ( btn ) . not . toHaveAttribute ( 'aria-describedby' ) ;
523- } ) ;
524-
525- it ( 'should not pass aria-describedby when overlay is empty' , ( ) => {
526- const { container } = render (
527- < Tooltip id = "test-id" overlay = { null } >
528- < button > Click me</ button >
529- </ Tooltip > ,
530- ) ;
531-
532- expect ( container . querySelector ( 'button' ) ) . not . toHaveAttribute ( 'aria-describedby' ) ;
533- } ) ;
534-
535505 it ( 'should set aria-describedby immediately when defaultVisible is true' , ( ) => {
536506 const { container } = render (
537507 < Tooltip defaultVisible overlay = "tooltip content" >
@@ -542,22 +512,7 @@ describe('rc-tooltip', () => {
542512 expect ( container . querySelector ( 'button' ) ) . toHaveAttribute ( 'aria-describedby' ) ;
543513 } ) ;
544514
545- it ( 'should only set aria-describedby for forceRender after visible' , async ( ) => {
546- const { container } = render (
547- < Tooltip forceRender trigger = { [ 'click' ] } overlay = "tooltip content" >
548- < button > Click me</ button >
549- </ Tooltip > ,
550- ) ;
551-
552- const btn = container . querySelector ( 'button' ) ;
553- expect ( btn ) . not . toHaveAttribute ( 'aria-describedby' ) ;
554-
555- fireEvent . click ( btn ) ;
556- await waitFakeTimers ( ) ;
557- expect ( btn ) . toHaveAttribute ( 'aria-describedby' ) ;
558- } ) ;
559-
560- it ( 'should remove aria-describedby when controlled hidden without destroy' , ( ) => {
515+ it ( 'should remove aria-describedby when controlled hidden' , ( ) => {
561516 const overlay = 'tooltip content' ;
562517 const { container, rerender } = render (
563518 < Tooltip overlay = { overlay } visible >
@@ -576,25 +531,6 @@ describe('rc-tooltip', () => {
576531 expect ( container . querySelector ( 'button' ) ) . not . toHaveAttribute ( 'aria-describedby' ) ;
577532 } ) ;
578533
579- it ( 'should remove aria-describedby when popup is destroyed on hide' , async ( ) => {
580- const { container } = render (
581- < Tooltip destroyOnHidden trigger = { [ 'click' ] } overlay = "tooltip content" >
582- < button > Click me</ button >
583- </ Tooltip > ,
584- ) ;
585-
586- const btn = container . querySelector ( 'button' ) ;
587- expect ( btn ) . not . toHaveAttribute ( 'aria-describedby' ) ;
588-
589- fireEvent . click ( btn ) ;
590- await waitFakeTimers ( ) ;
591- expect ( btn ) . toHaveAttribute ( 'aria-describedby' ) ;
592-
593- fireEvent . click ( btn ) ;
594- await waitFakeTimers ( ) ;
595- expect ( btn ) . not . toHaveAttribute ( 'aria-describedby' ) ;
596- } ) ;
597-
598534 it ( 'should preserve original props of children' , ( ) => {
599535 const onMouseEnter = jest . fn ( ) ;
600536
0 commit comments