* Gets a `HarnessPredicate` that can be used to search for a menu item with specific attributes. * @param options Options for filtering which menu item instances are considered a match. * @return a `HarnessPredicate` configured with the given options.
(
this: ComponentHarnessConstructor<T>,
options: MenuItemHarnessFilters = {},
)
| 154 | * @return a `HarnessPredicate` configured with the given options. |
| 155 | */ |
| 156 | static with<T extends MatMenuItemHarness>( |
| 157 | this: ComponentHarnessConstructor<T>, |
| 158 | options: MenuItemHarnessFilters = {}, |
| 159 | ): HarnessPredicate<T> { |
| 160 | return new HarnessPredicate(this, options) |
| 161 | .addOption('text', options.text, (harness, text) => |
| 162 | HarnessPredicate.stringMatches(harness.getText(), text), |
| 163 | ) |
| 164 | .addOption( |
| 165 | 'hasSubmenu', |
| 166 | options.hasSubmenu, |
| 167 | async (harness, hasSubmenu) => (await harness.hasSubmenu()) === hasSubmenu, |
| 168 | ); |
| 169 | } |
| 170 | |
| 171 | /** Whether the menu is disabled. */ |
| 172 | async isDisabled(): Promise<boolean> { |
nothing calls this directly
no test coverage detected