File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change 11< ng-template >
22 < div
33 class ="mat-mdc-menu-panel mdc-menu-surface mdc-menu-surface--open "
4+ [id] ="panelId "
45 [ngClass] ="_classList "
56 (keydown) ="_handleKeydown($event) "
67 (click) ="closed.emit('click') "
Original file line number Diff line number Diff line change @@ -74,6 +74,15 @@ describe('MatMenu', () => {
7474 overlayContainer . ngOnDestroy ( ) ;
7575 } ) ) ;
7676
77+ it ( 'should aria-controls the menu panel' , ( ) => {
78+ const fixture = createComponent ( SimpleMenu , [ ] , [ FakeIcon ] ) ;
79+ fixture . detectChanges ( ) ;
80+ fixture . componentInstance . trigger . openMenu ( ) ;
81+ fixture . detectChanges ( ) ;
82+ expect ( fixture . componentInstance . triggerEl . nativeElement . getAttribute ( 'aria-controls' ) )
83+ . toBe ( fixture . componentInstance . menu . panelId ) ;
84+ } ) ;
85+
7786 it ( 'should open the menu as an idempotent operation' , ( ) => {
7887 const fixture = createComponent ( SimpleMenu , [ ] , [ FakeIcon ] ) ;
7988 fixture . detectChanges ( ) ;
You can’t perform that action at this time.
0 commit comments