MCPcopy Index your code
hub / github.com/angular/components / getItems

Method getItems

src/material/menu/testing/menu-harness.ts:98–111  ·  view source on GitHub ↗

* Gets a list of `MatMenuItemHarness` representing the items in the menu. * @param filters Optionally filters which menu items are included.

(
    filters?: Omit<MenuItemHarnessFilters, 'ancestor'>,
  )

Source from the content-addressed store, hash-verified

96 * @param filters Optionally filters which menu items are included.
97 */
98 async getItems(
99 filters?: Omit<MenuItemHarnessFilters, 'ancestor'>,
100 ): Promise<MatMenuItemHarness[]> {
101 const panelId = await this._getPanelId();
102 if (panelId) {
103 return this._documentRootLocator.locatorForAll(
104 MatMenuItemHarness.with({
105 ...(filters || {}),
106 ancestor: `#${panelId}`,
107 } as MenuItemHarnessFilters),
108 )();
109 }
110 return [];
111 }
112
113 /**
114 * Clicks an item in the menu, and optionally continues clicking items in subsequent sub-menus.

Callers 6

clickItemMethod · 0.95
_getItemsMethod · 0.45

Calls 3

_getPanelIdMethod · 0.95
locatorForAllMethod · 0.80
withMethod · 0.45

Tested by 1