MCPcopy
hub / github.com/angular/components / with

Method with

src/material/input/testing/input-harness.ts:27–38  ·  view source on GitHub ↗

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

(options: InputHarnessFilters = {})

Source from the content-addressed store, hash-verified

25 * @return a `HarnessPredicate` configured with the given options.
26 */
27 static with(options: InputHarnessFilters = {}): HarnessPredicate<MatInputHarness> {
28 return new HarnessPredicate(MatInputHarness, options)
29 .addOption('value', options.value, (harness, value) => {
30 return HarnessPredicate.stringMatches(harness.getValue(), value);
31 })
32 .addOption('placeholder', options.placeholder, (harness, placeholder) => {
33 return HarnessPredicate.stringMatches(harness.getPlaceholder(), placeholder);
34 })
35 .addOption('label', options.label, (harness, label) => {
36 return HarnessPredicate.stringMatches(harness.getLabel(), label);
37 });
38 }
39
40 /** Whether the input is disabled. */
41 async isDisabled(): Promise<boolean> {

Calls 5

addOptionMethod · 0.80
stringMatchesMethod · 0.80
getLabelMethod · 0.65
getValueMethod · 0.45
getPlaceholderMethod · 0.45

Tested by

no test coverage detected