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