Skip to content

Commit

Permalink
fix(a11y): datagrid-fix tests for screen reader text
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrea Fernandes committed May 8, 2024
1 parent ee37aa1 commit a472f58
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions projects/angular/src/data/datagrid/datagrid.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -753,13 +753,12 @@ export default function (): void {
expect(actionOverflowCell.length).toEqual(0);
});

it('should have aria-label with value `Select one of actionable rows`', function () {
it('should have screen reader only text with value `Select one of actionable rows`', function () {
context = this.create(ClrDatagrid, ActionableRowTest);
context.getClarityProvider(RowActionService);
expect(
context.clarityElement
.querySelector('.datagrid-header .datagrid-column.datagrid-row-actions')
.getAttribute('aria-label')
context.clarityElement.querySelector('.datagrid-header .datagrid-column.datagrid-row-actions .clr-sr-only')
.textContent
).toBe('Select one of actionable rows');
});
});
Expand Down Expand Up @@ -805,9 +804,9 @@ export default function (): void {
const context = this.create(ClrDatagrid, ExpandableRowTest);
context.getClarityProvider(RowActionService);
expect(
context.clarityElement
.querySelector('.datagrid-header .datagrid-column.datagrid-expandable-caret')
.getAttribute('aria-label')
context.clarityElement.querySelector(
'.datagrid-header .datagrid-column.datagrid-expandable-caret .clr-sr-only'
).textContent
).toBe('Expand one of the rows');
});
});
Expand Down

0 comments on commit a472f58

Please sign in to comment.