import {MatMenuHarness} from '@angular/material/menu/testing';
MatMenuHarness
Harness for interacting with a standard mat-menu in tests.
Name | Description |
---|---|
|
The selector for the host element of a |
async
blur
|
|
---|---|
Blurs the menu. |
|
Returns | |
Promise<void>
|
Promise that resolves when the action completes. |
async
clickItem
|
|
---|---|
Clicks an item in the menu, and optionally continues clicking items in subsequent sub-menus. |
|
Parameters | |
itemFilter Omit<ItemFilters, "ancestor">
|
|
subItemFilters
|
|
...subItemFilters Omit<ItemFilters, "ancestor">[]
|
|
Returns | |
Promise<void>
|
Promise that resolves when the action completes. |
async
close
|
|
---|---|
Closes the menu. |
|
Returns | |
Promise<void>
|
Promise that resolves when the action completes. |
async
focus
|
|
---|---|
Focuses the menu. |
|
Returns | |
Promise<void>
|
Promise that resolves when the action completes. |
async
getAllChildLoaders
|
|
---|---|
Parameters | |
selector S
|
|
Returns | |
Promise<HarnessLoader[]>
|
|
async
getAllHarnesses
|
|
---|---|
Parameters | |
query HarnessQuery<T>
|
|
Returns | |
Promise<T[]>
|
|
async
getChildLoader
|
|
---|---|
Parameters | |
selector S
|
|
Returns | |
Promise<HarnessLoader>
|
|
async
getHarness
|
|
---|---|
Parameters | |
query HarnessQuery<T>
|
|
Returns | |
Promise<T>
|
|
async
getItems
|
|
---|---|
Gets a list of |
|
Parameters | |
filters? Omit<ItemFilters, "ancestor">
|
|
Returns | |
Promise<Item[]>
|
|
async
getTriggerText
|
|
---|---|
Gets the text of the menu's trigger element. |
|
Returns | |
Promise<string>
|
|
async
host
|
|
---|---|
Gets a |
|
Returns | |
Promise<TestElement>
|
|
async
isDisabled
|
|
---|---|
Whether the menu is disabled. |
|
Returns | |
Promise<boolean>
|
|
async
isFocused
|
|
---|---|
Whether the menu is focused. |
|
Returns | |
Promise<boolean>
|
|
async
isOpen
|
|
---|---|
Whether the menu is open. |
|
Returns | |
Promise<boolean>
|
|
async
open
|
|
---|---|
Opens the menu. |
|
Returns | |
Promise<void>
|
Promise that resolves when the action completes. |
static
with
|
|
---|---|
Gets a |
|
Parameters | |
options MenuHarnessFilters = {}
|
|
Returns | |
HarnessPredicate<MatMenuHarness>
|
a |
MatMenuItemHarness
Harness for interacting with a standard mat-menu-item in tests.
Name | Description |
---|---|
|
The selector for the host element of a |
async
blur
|
|
---|---|
Blurs the menu item. |
|
Returns | |
Promise<void>
|
Promise that resolves when the action completes. |
async
click
|
|
---|---|
Clicks the menu item. |
|
Returns | |
Promise<void>
|
Promise that resolves when the action completes. |
async
focus
|
|
---|---|
Focuses the menu item. |
|
Returns | |
Promise<void>
|
Promise that resolves when the action completes. |
async
getAllChildLoaders
|
|
---|---|
Parameters | |
selector S
|
|
Returns | |
Promise<HarnessLoader[]>
|
|
async
getAllHarnesses
|
|
---|---|
Parameters | |
query HarnessQuery<T>
|
|
Returns | |
Promise<T[]>
|
|
async
getChildLoader
|
|
---|---|
Parameters | |
selector S
|
|
Returns | |
Promise<HarnessLoader>
|
|
async
getHarness
|
|
---|---|
Parameters | |
query HarnessQuery<T>
|
|
Returns | |
Promise<T>
|
|
async
getSubmenu
|
|
---|---|
Gets the submenu associated with this menu item, or null if none. |
|
Returns | |
Promise<Menu | null>
|
|
async
getText
|
|
---|---|
Gets the text of the menu item. |
|
Returns | |
Promise<string>
|
|
async
hasSubmenu
|
|
---|---|
Whether this item has a submenu. |
|
Returns | |
Promise<boolean>
|
|
async
host
|
|
---|---|
Gets a |
|
Returns | |
Promise<TestElement>
|
|
async
isDisabled
|
|
---|---|
Whether the menu is disabled. |
|
Returns | |
Promise<boolean>
|
|
async
isFocused
|
|
---|---|
Whether the menu item is focused. |
|
Returns | |
Promise<boolean>
|
|
static
with
|
|
---|---|
Gets a |
|
Parameters | |
options MenuItemHarnessFilters = {}
|
|
Returns | |
HarnessPredicate<MatMenuItemHarness>
|
a |
MenuHarnessFilters
A set of criteria that can be used to filter a list of MatMenuHarness
instances.
Name | Description |
---|---|
|
Only find instances whose trigger text matches the given value. |
MenuItemHarnessFilters
A set of criteria that can be used to filter a list of MatMenuItemHarness
instances.
Name | Description |
---|---|
|
Only find instances that have a sub-menu. |
|
Only find instances whose text matches the given value. |