@@ -541,5 +541,82 @@ describe('timers', () => {
541541
542542 expect ( overlays [ 0 ] . opened ) . to . be . false ;
543543 } ) ;
544+
545+ it ( 'should not keep warmed up state on mouseenter to the manual tooltip target' , async ( ) => {
546+ tooltips [ 1 ] . manual = true ;
547+
548+ mouseenter ( targets [ 0 ] ) ;
549+ await aTimeout ( 2 ) ;
550+
551+ mouseleave ( targets [ 0 ] ) ;
552+ mouseenter ( targets [ 1 ] ) ;
553+ await aTimeout ( 2 ) ;
554+
555+ expect ( overlays [ 0 ] . opened ) . to . be . false ;
556+
557+ mouseleave ( targets [ 1 ] ) ;
558+ mouseenter ( targets [ 0 ] ) ;
559+ expect ( overlays [ 0 ] . opened ) . to . be . false ;
560+
561+ await aTimeout ( 2 ) ;
562+ expect ( overlays [ 0 ] . opened ) . to . be . true ;
563+ } ) ;
564+
565+ it ( 'should not keep warmed up state on focusout to the manual tooltip target' , async ( ) => {
566+ tooltips [ 1 ] . manual = true ;
567+
568+ tabKeyDown ( document . body ) ;
569+ focusin ( targets [ 0 ] ) ;
570+ await aTimeout ( 2 ) ;
571+
572+ focusout ( targets [ 0 ] , targets [ 1 ] ) ;
573+ focusin ( targets [ 1 ] , targets [ 0 ] ) ;
574+ await aTimeout ( 2 ) ;
575+
576+ expect ( overlays [ 0 ] . opened ) . to . be . false ;
577+
578+ focusout ( targets [ 1 ] , targets [ 0 ] ) ;
579+ focusin ( targets [ 0 ] , targets [ 1 ] ) ;
580+
581+ expect ( overlays [ 0 ] . opened ) . to . be . false ;
582+
583+ await aTimeout ( 2 ) ;
584+ expect ( overlays [ 0 ] . opened ) . to . be . true ;
585+ } ) ;
586+
587+ it ( 'should not restart cooldown on mouseleave from the manual tooltip target' , async ( ) => {
588+ tooltips [ 1 ] . manual = true ;
589+
590+ mouseenter ( targets [ 0 ] ) ;
591+ await aTimeout ( 2 ) ;
592+
593+ mouseleave ( targets [ 0 ] ) ;
594+ mouseenter ( targets [ 1 ] ) ;
595+ await aTimeout ( 1 ) ;
596+
597+ mouseleave ( targets [ 1 ] ) ;
598+ await aTimeout ( 1 ) ;
599+
600+ mouseenter ( targets [ 0 ] ) ;
601+ expect ( overlays [ 0 ] . opened ) . to . be . false ;
602+ } ) ;
603+
604+ it ( 'should not restart cooldown on focusout from the manual tooltip target' , async ( ) => {
605+ tooltips [ 1 ] . manual = true ;
606+
607+ tabKeyDown ( document . body ) ;
608+ focusin ( targets [ 0 ] ) ;
609+ await aTimeout ( 2 ) ;
610+
611+ focusout ( targets [ 0 ] , targets [ 1 ] ) ;
612+ focusin ( targets [ 1 ] , targets [ 0 ] ) ;
613+ await aTimeout ( 1 ) ;
614+
615+ focusout ( targets [ 1 ] ) ;
616+ await aTimeout ( 1 ) ;
617+
618+ focusin ( targets [ 0 ] ) ;
619+ expect ( overlays [ 0 ] . opened ) . to . be . false ;
620+ } ) ;
544621 } ) ;
545622} ) ;
0 commit comments