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 1
1
< ng-template >
2
2
< div
3
3
class ="mat-mdc-menu-panel mdc-menu-surface mdc-menu-surface--open "
4
+ [id] ="panelId "
4
5
[ngClass] ="_classList "
5
6
(keydown) ="_handleKeydown($event) "
6
7
(click) ="closed.emit('click') "
Original file line number Diff line number Diff line change @@ -74,6 +74,15 @@ describe('MatMenu', () => {
74
74
overlayContainer . ngOnDestroy ( ) ;
75
75
} ) ) ;
76
76
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
+
77
86
it ( 'should open the menu as an idempotent operation' , ( ) => {
78
87
const fixture = createComponent ( SimpleMenu , [ ] , [ FakeIcon ] ) ;
79
88
fixture . detectChanges ( ) ;
You can’t perform that action at this time.
0 commit comments