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

Method with

src/material/core/testing/optgroup-harness.ts:30–39  ·  view source on GitHub ↗

* Gets a `HarnessPredicate` that can be used to search for a option group with specific * attributes. * @param options Options for filtering which option instances are considered a match. * @return a `HarnessPredicate` configured with the given options.

(
    this: ComponentHarnessConstructor<T>,
    options: OptgroupHarnessFilters = {},
  )

Source from the content-addressed store, hash-verified

28 * @return a `HarnessPredicate` configured with the given options.
29 */
30 static with<T extends MatOptgroupHarness>(
31 this: ComponentHarnessConstructor<T>,
32 options: OptgroupHarnessFilters = {},
33 ): HarnessPredicate<T> {
34 return new HarnessPredicate(this, options).addOption(
35 'labelText',
36 options.labelText,
37 async (harness, title) => HarnessPredicate.stringMatches(await harness.getLabelText(), title),
38 );
39 }
40
41 /** Gets the option group's label text. */
42 async getLabelText(): Promise<string> {

Callers 1

getOptionsMethod · 0.45

Calls 3

addOptionMethod · 0.80
stringMatchesMethod · 0.80
getLabelTextMethod · 0.45

Tested by

no test coverage detected