MCPcopy Create free account
hub / github.com/angular/components / getMenuItem

Function getMenuItem

src/aria/menu/menu.spec.ts:1047–1052  ·  view source on GitHub ↗
(text: string)

Source from the content-addressed store, hash-verified

1045 }
1046
1047 function getMenuItem(text: string): HTMLElement | null {
1048 const items = fixture.debugElement
1049 .queryAll(By.directive(MenuItem))
1050 .map((debugEl: DebugElement) => debugEl.nativeElement as HTMLElement);
1051 return items.find(item => item.textContent?.trim() === text) || null;
1052 }
1053
1054 function isExpanded(menuBarItemText: string): boolean {
1055 return getMenuBarItem(menuBarItemText)?.getAttribute('aria-expanded') === 'true';

Callers 1

menu.spec.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected