import { AnimationEntryMetadata, OpaqueToken, ComponentRef, ComponentFactory, Injector, ViewMetadata, ElementRef, ChangeDetectorRef, NgZone, DebugElement } from '@angular/core'; import { Type } from '../src/facade/lang'; /** * An abstract class for inserting the root test component element in a platform independent way. */ export declare class TestComponentRenderer { insertRootElement(rootElementId: string): void; } export declare var ComponentFixtureAutoDetect: OpaqueToken; export declare var ComponentFixtureNoNgZone: OpaqueToken; /** * Fixture for debugging and testing a component. */ export declare class ComponentFixture { /** * The DebugElement associated with the root element of this component. */ debugElement: DebugElement; /** * The instance of the root component class. */ componentInstance: any; /** * The native element at the root of the component. */ nativeElement: any; /** * The ElementRef for the element at the root of the component. */ elementRef: ElementRef; /** * The ComponentRef for the component */ componentRef: ComponentRef; /** * The ChangeDetectorRef for the component */ changeDetectorRef: ChangeDetectorRef; /** * The NgZone in which this component was instantiated. */ ngZone: NgZone; private _autoDetect; private _isStable; private _completer; private _onUnstableSubscription; private _onStableSubscription; private _onMicrotaskEmptySubscription; private _onErrorSubscription; constructor(componentRef: ComponentRef, ngZone: NgZone, autoDetect: boolean); private _tick(checkNoChanges); /** * Trigger a change detection cycle for the component. */ detectChanges(checkNoChanges?: boolean): void; /** * Do a change detection run to make sure there were no changes. */ checkNoChanges(): void; /** * Set whether the fixture should autodetect changes. * * Also runs detectChanges once so that any existing change is detected. */ autoDetectChanges(autoDetect?: boolean): void; /** * Return whether the fixture is currently stable or has async tasks that have not been completed * yet. */ isStable(): boolean; /** * Get a promise that resolves when the fixture is stable. * * This can be used to resume testing after events have triggered asynchronous activity or * asynchronous change detection. */ whenStable(): Promise; /** * Trigger component destruction. */ destroy(): void; } /** * Builds a ComponentFixture for use in component level tests. */ export declare class TestComponentBuilder { private _injector; constructor(_injector: Injector); /** * Overrides only the html of a {@link ComponentMetadata}. * All the other properties of the component's {@link ViewMetadata} are preserved. */ overrideTemplate(componentType: Type, template: string): TestComponentBuilder; overrideAnimations(componentType: Type, animations: AnimationEntryMetadata[]): TestComponentBuilder; /** * Overrides a component's {@link ViewMetadata}. */ overrideView(componentType: Type, view: ViewMetadata): TestComponentBuilder; /** * Overrides the directives from the component {@link ViewMetadata}. */ overrideDirective(componentType: Type, from: Type, to: Type): TestComponentBuilder; /** * Overrides one or more injectables configured via `providers` metadata property of a directive * or * component. * Very useful when certain providers need to be mocked out. * * The providers specified via this method are appended to the existing `providers` causing the * duplicated providers to * be overridden. */ overrideProviders(type: Type, providers: any[]): TestComponentBuilder; /** * @deprecated */ overrideBindings(type: Type, providers: any[]): TestComponentBuilder; /** * Overrides one or more injectables configured via `providers` metadata property of a directive * or * component. * Very useful when certain providers need to be mocked out. * * The providers specified via this method are appended to the existing `providers` causing the * duplicated providers to * be overridden. */ overrideViewProviders(type: Type, providers: any[]): TestComponentBuilder; /** * @deprecated */ overrideViewBindings(type: Type, providers: any[]): TestComponentBuilder; private _create(ngZone, componentFactory); /** * Builds and returns a ComponentFixture. */ createAsync(rootComponentType: Type): Promise>; createFakeAsync(rootComponentType: Type): ComponentFixture; createSync(componentFactory: ComponentFactory): ComponentFixture; }