@@ -7,7 +7,7 @@ import {MdTooltipModule} from './tooltip';
77
88const initialTooltipMessage = 'initial tooltip message' ;
99
10- describe ( 'MdTooltip' , ( ) => {
10+ fdescribe ( 'MdTooltip' , ( ) => {
1111 let overlayContainerElement : HTMLElement ;
1212
1313
@@ -49,14 +49,29 @@ describe('MdTooltip', () => {
4949 fixture . detectChanges ( ) ;
5050 expect ( overlayContainerElement . textContent ) . toContain ( initialTooltipMessage ) ;
5151
52+ // After hide called, a timeout delay is created that will to hide the tooltip.
5253 tooltipDirective . hide ( ) ;
5354 expect ( tooltipDirective . _isTooltipVisible ( ) ) . toBe ( true ) ;
5455
55- // After hidden , expect that the tooltip is not visible.
56+ // After the tooltip delay elapses , expect that the tooltip is not visible.
5657 tick ( TOOLTIP_HIDE_DELAY ) ;
5758 expect ( tooltipDirective . _isTooltipVisible ( ) ) . toBe ( false ) ;
5859 } ) ) ;
5960
61+ fit ( 'should not follow through with hide if show is called after' , fakeAsync ( ( ) => {
62+ tooltipDirective . show ( ) ;
63+ expect ( tooltipDirective . _isTooltipVisible ( ) ) . toBe ( true ) ;
64+
65+ // After hide called, a timeout delay is created that will to hide the tooltip.
66+ tooltipDirective . hide ( ) ;
67+ expect ( tooltipDirective . _isTooltipVisible ( ) ) . toBe ( true ) ;
68+
69+ // Before delay time has passed, call show which should cancel intent to hide tooltip.
70+ tooltipDirective . show ( ) ;
71+ tick ( TOOLTIP_HIDE_DELAY ) ;
72+ expect ( tooltipDirective . _isTooltipVisible ( ) ) . toBe ( true ) ;
73+ } ) ) ;
74+
6075 it ( 'should remove the tooltip when changing position' , ( ) => {
6176 const initialPosition : TooltipPosition = 'below' ;
6277 const changedPosition : TooltipPosition = 'above' ;
0 commit comments