Skip to content

Commit 25537fe

Browse files
committed
fixup! fix(cdk/table): set default role of table to 'table'
1 parent 4afb18d commit 25537fe

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/cdk/table/table.spec.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -611,6 +611,19 @@ describe('CdkTable', () => {
611611
it('should not clobber an existing table role', () => {
612612
setupTableTestApp(CustomRoleCdkTableApp);
613613
expect(tableElement.getAttribute('role')).toBe('treegrid');
614+
615+
expect(getHeaderRows(tableElement)[0].getAttribute('role')).toBe('row');
616+
const header = getHeaderRows(tableElement)[0];
617+
getHeaderCells(header).forEach(cell => {
618+
expect(cell.getAttribute('role')).toBe('columnheader');
619+
});
620+
621+
getRows(tableElement).forEach(row => {
622+
expect(row.getAttribute('role')).toBe('row');
623+
getCells(row).forEach(cell => {
624+
expect(cell.getAttribute('role')).toBe('gridcell');
625+
});
626+
});
614627
});
615628

616629
it('should throw an error if two column definitions have the same name', () => {

0 commit comments

Comments
 (0)