mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
chore(tooltip): remove TestComponentBuilder (#1023)
This commit is contained in:
@@ -1,11 +1,4 @@
|
||||
import {
|
||||
inject,
|
||||
async,
|
||||
addProviders,
|
||||
TestComponentBuilder,
|
||||
ComponentFixture,
|
||||
TestBed,
|
||||
} from '@angular/core/testing';
|
||||
import {async, ComponentFixture, TestBed} from '@angular/core/testing';
|
||||
import {Component, DebugElement} from '@angular/core';
|
||||
import {By} from '@angular/platform-browser';
|
||||
import {TooltipPosition, MdTooltip} from '@angular2-material/tooltip/tooltip';
|
||||
@@ -14,29 +7,23 @@ import {MdTooltipModule} from './tooltip';
|
||||
|
||||
|
||||
describe('MdTooltip', () => {
|
||||
let builder: TestComponentBuilder;
|
||||
let overlayContainerElement: HTMLElement;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [MdTooltipModule],
|
||||
declarations: [BasicTooltipDemo],
|
||||
providers: [
|
||||
{provide: OverlayContainer, useFactory: () => {
|
||||
overlayContainerElement = document.createElement('div');
|
||||
return {getContainerElement: () => overlayContainerElement};
|
||||
}}
|
||||
]
|
||||
});
|
||||
|
||||
addProviders([
|
||||
{provide: OverlayContainer, useFactory: () => {
|
||||
overlayContainerElement = document.createElement('div');
|
||||
return {getContainerElement: () => overlayContainerElement};
|
||||
}}
|
||||
]);
|
||||
|
||||
TestBed.compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(inject([TestComponentBuilder], (tcb: TestComponentBuilder) => {
|
||||
builder = tcb;
|
||||
}));
|
||||
|
||||
describe('basic usage', () => {
|
||||
let fixture: ComponentFixture<BasicTooltipDemo>;
|
||||
let buttonDebugElement: DebugElement;
|
||||
@@ -44,13 +31,11 @@ describe('MdTooltip', () => {
|
||||
let tooltipDirective: MdTooltip;
|
||||
|
||||
beforeEach(async(() => {
|
||||
builder.createAsync(BasicTooltipDemo).then(f => {
|
||||
fixture = f;
|
||||
fixture.detectChanges();
|
||||
buttonDebugElement = fixture.debugElement.query(By.css('button'));
|
||||
buttonElement = <HTMLButtonElement> buttonDebugElement.nativeElement;
|
||||
tooltipDirective = buttonDebugElement.injector.get(MdTooltip);
|
||||
});
|
||||
fixture = TestBed.createComponent(BasicTooltipDemo);
|
||||
fixture.detectChanges();
|
||||
buttonDebugElement = fixture.debugElement.query(By.css('button'));
|
||||
buttonElement = <HTMLButtonElement> buttonDebugElement.nativeElement;
|
||||
tooltipDirective = buttonDebugElement.injector.get(MdTooltip);
|
||||
}));
|
||||
|
||||
it('should show/hide on mouse enter/leave', async(() => {
|
||||
|
||||
Reference in New Issue
Block a user