* 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 = {},
)
| 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> { |
no test coverage detected