1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 | import { ChangeDetectorRef, ComponentRef, DebugElement, ElementRef, NgZone } from '@angular/core';
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 | export declare class ComponentFixture<T> {
|
15 | componentRef: ComponentRef<T>;
|
16 | ngZone: NgZone;
|
17 | private _autoDetect;
|
18 | |
19 |
|
20 |
|
21 | debugElement: DebugElement;
|
22 | |
23 |
|
24 |
|
25 | componentInstance: T;
|
26 | |
27 |
|
28 |
|
29 | nativeElement: any;
|
30 | |
31 |
|
32 |
|
33 | elementRef: ElementRef;
|
34 | |
35 |
|
36 |
|
37 | changeDetectorRef: ChangeDetectorRef;
|
38 | private _isStable;
|
39 | private _isDestroyed;
|
40 | private _resolve;
|
41 | private _promise;
|
42 | private _onUnstableSubscription;
|
43 | private _onStableSubscription;
|
44 | private _onMicrotaskEmptySubscription;
|
45 | private _onErrorSubscription;
|
46 | constructor(componentRef: ComponentRef<T>, ngZone: NgZone, _autoDetect: boolean);
|
47 | private _tick(checkNoChanges);
|
48 | /**
|
49 | * Trigger a change detection cycle for the component.
|
50 | */
|
51 | detectChanges(checkNoChanges?: boolean): void;
|
52 | /**
|
53 | * Do a change detection run to make sure there were no changes.
|
54 | */
|
55 | checkNoChanges(): void;
|
56 | /**
|
57 | * Set whether the fixture should autodetect changes.
|
58 | *
|
59 | * Also runs detectChanges once so that any existing change is detected.
|
60 | */
|
61 | autoDetectChanges(autoDetect?: boolean): void;
|
62 | /**
|
63 | * Return whether the fixture is currently stable or has async tasks that have not been completed
|
64 | * yet.
|
65 | */
|
66 | isStable(): boolean;
|
67 | /**
|
68 | * Get a promise that resolves when the fixture is stable.
|
69 | *
|
70 | * This can be used to resume testing after events have triggered asynchronous activity or
|
71 | * asynchronous change detection.
|
72 | */
|
73 | whenStable(): Promise<any>;
|
74 | /**
|
75 | * Trigger component destruction.
|
76 | */
|
77 | destroy(): void;
|
78 | }
|