File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change 11< table class ="mat-calendar-table " role ="presentation ">
22 < thead class ="mat-calendar-table-header ">
3- < tr > < th *ngFor ="let day of _weekdays " [attr.aria-label] ="day.long "> {{day.narrow}}</ th > </ tr >
3+ < tr >
4+ < th scope ="col " *ngFor ="let day of _weekdays " [attr.aria-label] ="day.long "> {{day.narrow}}</ th >
5+ </ tr >
46 < tr > < th class ="mat-calendar-table-header-divider " colspan ="7 " aria-hidden ="true "> </ th > </ tr >
57 </ thead >
68 < tbody mat-calendar-body
Original file line number Diff line number Diff line change @@ -103,6 +103,18 @@ describe('MatMonthView', () => {
103103 expect ( table . getAttribute ( 'role' ) ) . toBe ( 'presentation' ) ;
104104 } ) ;
105105
106+ it ( 'should set the correct scope on the table headers' , ( ) => {
107+ const nonDividerHeaders = monthViewNativeElement . querySelectorAll (
108+ '.mat-calendar-table-header th:not(.mat-calendar-table-header-divider)' ) ;
109+ const dividerHeader =
110+ monthViewNativeElement . querySelector ( '.mat-calendar-table-header-divider' ) ! ;
111+
112+ expect ( Array . from ( nonDividerHeaders ) . every ( header => {
113+ return header . getAttribute ( 'scope' ) === 'col' ;
114+ } ) ) . toBe ( true ) ;
115+ expect ( dividerHeader . hasAttribute ( 'scope' ) ) . toBe ( false ) ;
116+ } ) ;
117+
106118 describe ( 'calendar body' , ( ) => {
107119 let calendarBodyEl : HTMLElement ;
108120 let calendarInstance : StandardMonthView ;
You can’t perform that action at this time.
0 commit comments