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

Method with

src/material/chips/testing/chip-harness.ts:38–49  ·  view source on GitHub ↗

* Gets a `HarnessPredicate` that can be used to search for a chip with specific attributes. * @param options Options for narrowing the search. * @return a `HarnessPredicate` configured with the given options.

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

Source from the content-addressed store, hash-verified

36 * @return a `HarnessPredicate` configured with the given options.
37 */
38 static with<T extends MatChipHarness>(
39 this: ComponentHarnessConstructor<T>,
40 options: ChipHarnessFilters = {},
41 ): HarnessPredicate<T> {
42 return new HarnessPredicate(this, options)
43 .addOption('text', options.text, (harness, label) => {
44 return HarnessPredicate.stringMatches(harness.getText(), label);
45 })
46 .addOption('disabled', options.disabled, async (harness, disabled) => {
47 return (await harness.isDisabled()) === disabled;
48 });
49 }
50
51 /** Gets a promise for the text content the option. */
52 async getText(): Promise<string> {

Callers 10

geEditButtonMethod · 0.45
getRemoveButtonMethod · 0.45
getAvatarMethod · 0.45
getLeadingIconMethod · 0.45
getEditInputMethod · 0.45

Calls 4

addOptionMethod · 0.80
stringMatchesMethod · 0.80
getTextMethod · 0.45
isDisabledMethod · 0.45

Tested by

no test coverage detected