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

Function locatorForOptional

src/cdk/testing/component-harness.ts:407–411  ·  view source on GitHub ↗

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

(
    ...queries: T
  )

Source from the content-addressed store, hash-verified

405 * result types for each query or null.
406 */
407 protected locatorForOptional<T extends (HarnessQuery<any> | string)[]>(
408 ...queries: T
409 ): () => Promise<LocatorFnResult<T> | null> {
410 return this.locatorFactory.locatorForOptional(...queries);
411 }
412
413 /**
414 * Creates an asynchronous locator function that can be used to find `ComponentHarness` instances

Callers

nothing calls this directly

Calls 1

locatorForOptionalMethod · 0.80

Tested by

no test coverage detected