@@ -7,7 +7,7 @@ import {MdTooltipModule} from './tooltip';
7
7
8
8
const initialTooltipMessage = 'initial tooltip message' ;
9
9
10
- describe ( 'MdTooltip' , ( ) => {
10
+ fdescribe ( 'MdTooltip' , ( ) => {
11
11
let overlayContainerElement : HTMLElement ;
12
12
13
13
@@ -49,14 +49,29 @@ describe('MdTooltip', () => {
49
49
fixture . detectChanges ( ) ;
50
50
expect ( overlayContainerElement . textContent ) . toContain ( initialTooltipMessage ) ;
51
51
52
+ // After hide called, a timeout delay is created that will to hide the tooltip.
52
53
tooltipDirective . hide ( ) ;
53
54
expect ( tooltipDirective . _isTooltipVisible ( ) ) . toBe ( true ) ;
54
55
55
- // After hidden , expect that the tooltip is not visible.
56
+ // After the tooltip delay elapses , expect that the tooltip is not visible.
56
57
tick ( TOOLTIP_HIDE_DELAY ) ;
57
58
expect ( tooltipDirective . _isTooltipVisible ( ) ) . toBe ( false ) ;
58
59
} ) ) ;
59
60
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
+
60
75
it ( 'should remove the tooltip when changing position' , ( ) => {
61
76
const initialPosition : TooltipPosition = 'below' ;
62
77
const changedPosition : TooltipPosition = 'above' ;
0 commit comments