source: trip-planner-front/node_modules/@angular/cdk/testing/testbed/testbed-harness-environment.d.ts@ 6fe77af

Last change on this file since 6fe77af was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 3.4 KB
Line 
1/**
2 * @license
3 * Copyright Google LLC All Rights Reserved.
4 *
5 * Use of this source code is governed by an MIT-style license that can be
6 * found in the LICENSE file at https://angular.io/license
7 */
8import { ComponentHarness, ComponentHarnessConstructor, HarnessEnvironment, HarnessLoader, TestElement } from '@angular/cdk/testing';
9import { ComponentFixture } from '@angular/core/testing';
10/** Options to configure the environment. */
11export interface TestbedHarnessEnvironmentOptions {
12 /** The query function used to find DOM elements. */
13 queryFn: (selector: string, root: Element) => Iterable<Element> | ArrayLike<Element>;
14}
15/** A `HarnessEnvironment` implementation for Angular's Testbed. */
16export declare class TestbedHarnessEnvironment extends HarnessEnvironment<Element> {
17 private _fixture;
18 /** Whether the environment has been destroyed. */
19 private _destroyed;
20 /** Observable that emits whenever the test task state changes. */
21 private _taskState;
22 /** The options for this environment. */
23 private _options;
24 protected constructor(rawRootElement: Element, _fixture: ComponentFixture<unknown>, options?: TestbedHarnessEnvironmentOptions);
25 /** Creates a `HarnessLoader` rooted at the given fixture's root element. */
26 static loader(fixture: ComponentFixture<unknown>, options?: TestbedHarnessEnvironmentOptions): HarnessLoader;
27 /**
28 * Creates a `HarnessLoader` at the document root. This can be used if harnesses are
29 * located outside of a fixture (e.g. overlays appended to the document body).
30 */
31 static documentRootLoader(fixture: ComponentFixture<unknown>, options?: TestbedHarnessEnvironmentOptions): HarnessLoader;
32 /** Gets the native DOM element corresponding to the given TestElement. */
33 static getNativeElement(el: TestElement): Element;
34 /**
35 * Creates an instance of the given harness type, using the fixture's root element as the
36 * harness's host element. This method should be used when creating a harness for the root element
37 * of a fixture, as components do not have the correct selector when they are created as the root
38 * of the fixture.
39 */
40 static harnessForFixture<T extends ComponentHarness>(fixture: ComponentFixture<unknown>, harnessType: ComponentHarnessConstructor<T>, options?: TestbedHarnessEnvironmentOptions): Promise<T>;
41 /**
42 * Flushes change detection and async tasks captured in the Angular zone.
43 * In most cases it should not be necessary to call this manually. However, there may be some edge
44 * cases where it is needed to fully flush animation events.
45 */
46 forceStabilize(): Promise<void>;
47 /**
48 * Waits for all scheduled or running async tasks to complete. This allows harness
49 * authors to wait for async tasks outside of the Angular zone.
50 */
51 waitForTasksOutsideAngular(): Promise<void>;
52 /** Gets the root element for the document. */
53 protected getDocumentRoot(): Element;
54 /** Creates a `TestElement` from a raw element. */
55 protected createTestElement(element: Element): TestElement;
56 /** Creates a `HarnessLoader` rooted at the given raw element. */
57 protected createEnvironment(element: Element): HarnessEnvironment<Element>;
58 /**
59 * Gets a list of all elements matching the given selector under this environment's root element.
60 */
61 protected getAllRawElements(selector: string): Promise<Element[]>;
62}
Note: See TracBrowser for help on using the repository browser.