(text: string)
| 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'; |