MCPcopy Create free account
hub / github.com/angular/components / locatorFor

Function locatorFor

src/cdk/testing/harness-environment.ts:96–104  ·  view source on GitHub ↗

* Creates an asynchronous locator function that can be used to find a `ComponentHarness` instance * or element under the root element of this `HarnessEnvironment`. * * For example, given the following DOM and assuming `DivHarness.hostSelector` is `'div'` * * ```html *

(
    ...queries: T
  )

Source from the content-addressed store, hash-verified

94 * each query.
95 */
96 locatorFor<T extends (HarnessQuery<any> | string)[]>(
97 ...queries: T
98 ): () => Promise<LocatorFnResult<T>> {
99 return () =>
100 _assertResultFound(
101 this._getAllHarnessesAndTestElements(queries),
102 _getDescriptionForLocatorForQueries(queries),
103 );
104 }
105
106 /**
107 * Creates an asynchronous locator function that can be used to find a `ComponentHarness` instance

Callers

nothing calls this directly

Calls 2

_assertResultFoundFunction · 0.85

Tested by

no test coverage detected