|
1 |
| -import {async, ComponentFixture, TestBed, tick, fakeAsync} from '@angular/core/testing'; |
| 1 | +import { |
| 2 | + async, ComponentFixture, TestBed, tick, fakeAsync, |
| 3 | + flushMicrotasks |
| 4 | +} from '@angular/core/testing'; |
2 | 5 | import {Component, DebugElement} from '@angular/core';
|
3 | 6 | import {By} from '@angular/platform-browser';
|
4 | 7 | import {TooltipPosition, MdTooltip, TOOLTIP_HIDE_DELAY, MdTooltipModule} from './tooltip';
|
5 | 8 | import {OverlayContainer} from '../core';
|
6 | 9 |
|
7 | 10 | const initialTooltipMessage = 'initial tooltip message';
|
8 | 11 |
|
9 |
| -describe('MdTooltip', () => { |
| 12 | +fdescribe('MdTooltip', () => { |
10 | 13 | let overlayContainerElement: HTMLElement;
|
11 | 14 |
|
12 | 15 |
|
@@ -58,9 +61,8 @@ describe('MdTooltip', () => {
|
58 | 61 | expect(tooltipDirective._isTooltipVisible()).toBe(false);
|
59 | 62 |
|
60 | 63 | // On animation complete, should expect that the tooltip has been detached.
|
61 |
| - fixture.whenStable().then(() => { |
62 |
| - expect(tooltipDirective._tooltipInstance).toBeNull(); |
63 |
| - }); |
| 64 | + flushMicrotasks(); |
| 65 | + expect(tooltipDirective._tooltipInstance).toBeNull(); |
64 | 66 | }));
|
65 | 67 |
|
66 | 68 | it('should not follow through with hide if show is called after', fakeAsync(() => {
|
@@ -114,8 +116,9 @@ describe('MdTooltip', () => {
|
114 | 116 | });
|
115 | 117 |
|
116 | 118 | it('should be removed after parent destroyed', () => {
|
117 |
| - tooltipDirective._handleMouseEnter(null); |
118 |
| - expect(tooltipDirective.visible).toBeTruthy(); |
| 119 | + tooltipDirective.show(); |
| 120 | + expect(tooltipDirective._isTooltipVisible()).toBe(true); |
| 121 | + |
119 | 122 | fixture.destroy();
|
120 | 123 | expect(overlayContainerElement.childNodes.length).toBe(0);
|
121 | 124 | expect(overlayContainerElement.textContent).toBe('');
|
|
0 commit comments