* Gets a `HarnessPredicate` that can be used to search for a select with specific attributes. * @param options Options for filtering which select instances are considered a match. * @return a `HarnessPredicate` configured with the given options.
(
this: ComponentHarnessConstructor<T>,
options: SelectHarnessFilters = {},
)
| 31 | * @return a `HarnessPredicate` configured with the given options. |
| 32 | */ |
| 33 | static with<T extends MatSelectHarness>( |
| 34 | this: ComponentHarnessConstructor<T>, |
| 35 | options: SelectHarnessFilters = {}, |
| 36 | ): HarnessPredicate<T> { |
| 37 | return new HarnessPredicate(this, options) |
| 38 | .addOption('disabled', options.disabled, async (harness, disabled) => { |
| 39 | return (await harness.isDisabled()) === disabled; |
| 40 | }) |
| 41 | .addOption('label', options.label, (harness, label) => { |
| 42 | return HarnessPredicate.stringMatches(harness.getLabel(), label); |
| 43 | }); |
| 44 | } |
| 45 | |
| 46 | /** Gets a boolean promise indicating if the select is disabled. */ |
| 47 | async isDisabled(): Promise<boolean> { |
no test coverage detected