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

Function hasHarness

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

* Searches for an instance of the component corresponding to the given harness type under the * `HarnessEnvironment`'s root element, and returns a boolean indicating if any were found. * @param query A query for a harness to create * @return A boolean indicating if an instance was found.

(query: HarnessQuery<T>)

Source from the content-addressed store, hash-verified

299 * @return A boolean indicating if an instance was found.
300 */
301 async hasHarness<T extends ComponentHarness>(query: HarnessQuery<T>): Promise<boolean> {
302 return (await this.locatorForOptional(query)()) !== null;
303 }
304
305 /**
306 * Searches for an element with the given selector under the evironment's root element,

Callers

nothing calls this directly

Calls 1

locatorForOptionalMethod · 0.80

Tested by

no test coverage detected