@@ -453,6 +453,36 @@ describe('MDCTooltip', () => {
453453 expect ( anchorElem . getAttribute ( 'aria-expanded' ) ) . toEqual ( 'false' ) ;
454454 } ) ;
455455
456+ it ( 'aria-expanded remains true on anchor when mouseleave anchor while tooltip is shown' ,
457+ ( ) => {
458+ const tooltipElem = fixture . querySelector < HTMLElement > ( '#tt0' ) ! ;
459+ const anchorElem =
460+ fixture . querySelector < HTMLElement > ( '[aria-describedby]' ) ! ;
461+ MDCTooltip . attachTo ( tooltipElem ) ;
462+
463+ emitEvent ( anchorElem , 'click' ) ;
464+ expect ( tooltipElem . getAttribute ( 'aria-hidden' ) ) . toEqual ( 'false' ) ;
465+ expect ( anchorElem . getAttribute ( 'aria-expanded' ) ) . toEqual ( 'true' ) ;
466+ emitEvent ( anchorElem , 'mouseleave' ) ;
467+
468+ expect ( anchorElem . getAttribute ( 'aria-expanded' ) ) . toEqual ( 'true' ) ;
469+ } ) ;
470+
471+ it ( 'aria-expanded remains true on anchor when mouseleave tooltip while tooltip is shown' ,
472+ ( ) => {
473+ const tooltipElem = fixture . querySelector < HTMLElement > ( '#tt0' ) ! ;
474+ const anchorElem =
475+ fixture . querySelector < HTMLElement > ( '[aria-describedby]' ) ! ;
476+ MDCTooltip . attachTo ( tooltipElem ) ;
477+
478+ emitEvent ( anchorElem , 'click' ) ;
479+ expect ( tooltipElem . getAttribute ( 'aria-hidden' ) ) . toEqual ( 'false' ) ;
480+ expect ( anchorElem . getAttribute ( 'aria-expanded' ) ) . toEqual ( 'true' ) ;
481+ emitEvent ( tooltipElem , 'mouseleave' ) ;
482+
483+ expect ( anchorElem . getAttribute ( 'aria-expanded' ) ) . toEqual ( 'true' ) ;
484+ } ) ;
485+
456486 it ( 'aria-expanded becomes false on anchor when anchor blurs and non-tooltip element is focused' ,
457487 ( ) => {
458488 // FocusEvent is not supported on IE11 so this test will not be run on
0 commit comments