11import {
2- async , ComponentFixture , TestBed , tick , fakeAsync ,
2+ async ,
3+ ComponentFixture ,
4+ TestBed ,
5+ tick ,
6+ fakeAsync ,
37 flushMicrotasks
48} from '@angular/core/testing' ;
59import { Component , DebugElement , AnimationTransitionEvent } from '@angular/core' ;
610import { By } from '@angular/platform-browser' ;
7- import { TooltipPosition , MdTooltip , TOOLTIP_HIDE_DELAY , MdTooltipModule } from './tooltip' ;
11+ import { TooltipPosition , MdTooltip , MdTooltipModule } from './tooltip' ;
812import { OverlayContainer } from '../core' ;
913
1014const initialTooltipMessage = 'initial tooltip message' ;
@@ -52,11 +56,12 @@ describe('MdTooltip', () => {
5256 expect ( overlayContainerElement . textContent ) . toContain ( initialTooltipMessage ) ;
5357
5458 // After hide called, a timeout delay is created that will to hide the tooltip.
55- tooltipDirective . hide ( ) ;
59+ const tooltipDelay = 1000 ;
60+ tooltipDirective . hide ( tooltipDelay ) ;
5661 expect ( tooltipDirective . _isTooltipVisible ( ) ) . toBe ( true ) ;
5762
5863 // After the tooltip delay elapses, expect that the tooltip is not visible.
59- tick ( TOOLTIP_HIDE_DELAY ) ;
64+ tick ( tooltipDelay ) ;
6065 fixture . detectChanges ( ) ;
6166 expect ( tooltipDirective . _isTooltipVisible ( ) ) . toBe ( false ) ;
6267
@@ -70,12 +75,13 @@ describe('MdTooltip', () => {
7075 expect ( tooltipDirective . _isTooltipVisible ( ) ) . toBe ( true ) ;
7176
7277 // After hide called, a timeout delay is created that will to hide the tooltip.
73- tooltipDirective . hide ( ) ;
78+ const tooltipDelay = 1000 ;
79+ tooltipDirective . hide ( tooltipDelay ) ;
7480 expect ( tooltipDirective . _isTooltipVisible ( ) ) . toBe ( true ) ;
7581
7682 // Before delay time has passed, call show which should cancel intent to hide tooltip.
7783 tooltipDirective . show ( ) ;
78- tick ( TOOLTIP_HIDE_DELAY ) ;
84+ tick ( tooltipDelay ) ;
7985 expect ( tooltipDirective . _isTooltipVisible ( ) ) . toBe ( true ) ;
8086 } ) ) ;
8187
0 commit comments