Skip to content

Commit df20a28

Browse files
authored
chore(tooltip): remove TestComponentBuilder (#1023)
1 parent 708662d commit df20a28

File tree

1 file changed

+12
-27
lines changed

1 file changed

+12
-27
lines changed

src/components/tooltip/tooltip.spec.ts

Lines changed: 12 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,4 @@
1-
import {
2-
inject,
3-
async,
4-
addProviders,
5-
TestComponentBuilder,
6-
ComponentFixture,
7-
TestBed,
8-
} from '@angular/core/testing';
1+
import {async, ComponentFixture, TestBed} from '@angular/core/testing';
92
import {Component, DebugElement} from '@angular/core';
103
import {By} from '@angular/platform-browser';
114
import {TooltipPosition, MdTooltip} from '@angular2-material/tooltip/tooltip';
@@ -14,43 +7,35 @@ import {MdTooltipModule} from './tooltip';
147

158

169
describe('MdTooltip', () => {
17-
let builder: TestComponentBuilder;
1810
let overlayContainerElement: HTMLElement;
1911

2012
beforeEach(async(() => {
2113
TestBed.configureTestingModule({
2214
imports: [MdTooltipModule],
2315
declarations: [BasicTooltipDemo],
16+
providers: [
17+
{provide: OverlayContainer, useFactory: () => {
18+
overlayContainerElement = document.createElement('div');
19+
return {getContainerElement: () => overlayContainerElement};
20+
}}
21+
]
2422
});
2523

26-
addProviders([
27-
{provide: OverlayContainer, useFactory: () => {
28-
overlayContainerElement = document.createElement('div');
29-
return {getContainerElement: () => overlayContainerElement};
30-
}}
31-
]);
32-
3324
TestBed.compileComponents();
3425
}));
3526

36-
beforeEach(inject([TestComponentBuilder], (tcb: TestComponentBuilder) => {
37-
builder = tcb;
38-
}));
39-
4027
describe('basic usage', () => {
4128
let fixture: ComponentFixture<BasicTooltipDemo>;
4229
let buttonDebugElement: DebugElement;
4330
let buttonElement: HTMLButtonElement;
4431
let tooltipDirective: MdTooltip;
4532

4633
beforeEach(async(() => {
47-
builder.createAsync(BasicTooltipDemo).then(f => {
48-
fixture = f;
49-
fixture.detectChanges();
50-
buttonDebugElement = fixture.debugElement.query(By.css('button'));
51-
buttonElement = <HTMLButtonElement> buttonDebugElement.nativeElement;
52-
tooltipDirective = buttonDebugElement.injector.get(MdTooltip);
53-
});
34+
fixture = TestBed.createComponent(BasicTooltipDemo);
35+
fixture.detectChanges();
36+
buttonDebugElement = fixture.debugElement.query(By.css('button'));
37+
buttonElement = <HTMLButtonElement> buttonDebugElement.nativeElement;
38+
tooltipDirective = buttonDebugElement.injector.get(MdTooltip);
5439
}));
5540

5641
it('should show/hide on mouse enter/leave', async(() => {

0 commit comments

Comments
 (0)