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

Method with

src/material/icon/testing/icon-harness.ts:23–32  ·  view source on GitHub ↗

* Gets a `HarnessPredicate` that can be used to search for a `MatIconHarness` that meets * certain criteria. * @param options Options for filtering which icon instances are considered a match. * @return a `HarnessPredicate` configured with the given options.

(options: IconHarnessFilters = {})

Source from the content-addressed store, hash-verified

21 * @return a `HarnessPredicate` configured with the given options.
22 */
23 static with(options: IconHarnessFilters = {}): HarnessPredicate<MatIconHarness> {
24 return new HarnessPredicate(MatIconHarness, options)
25 .addOption('type', options.type, async (harness, type) => (await harness.getType()) === type)
26 .addOption('name', options.name, (harness, text) =>
27 HarnessPredicate.stringMatches(harness.getName(), text),
28 )
29 .addOption('namespace', options.namespace, (harness, text) =>
30 HarnessPredicate.stringMatches(harness.getNamespace(), text),
31 );
32 }
33
34 /** Gets the type of the icon. */
35 async getType(): Promise<IconType> {

Callers 1

Calls 5

addOptionMethod · 0.80
stringMatchesMethod · 0.80
getNamespaceMethod · 0.80
getTypeMethod · 0.45
getNameMethod · 0.45

Tested by

no test coverage detected