Skip to content

Commit

Permalink
fix a11y for selection control
Browse files Browse the repository at this point in the history
  • Loading branch information
pan-kot committed Aug 28, 2023
1 parent 750b43d commit ca6157d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 17 deletions.
30 changes: 14 additions & 16 deletions src/__a11y__/run-a11y-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,19 @@ function urlFormatter(inputUrl: string, theme: Theme, mode: Mode) {

export default function runA11yTests(theme: Theme, mode: Mode, skip: string[] = []) {
describe(`A11y checks for ${mode} ${theme}`, () => {
findAllPages()
.filter(url => url.includes('grid-navigation'))
.forEach(inputUrl => {
const skipPages = [
...skip,
'theming/tokens',
// this page intentionally has issues to test the helper
'undefined-texts',
];
const testFunction = skipPages.includes(inputUrl) ? test.skip : test;
const url = urlFormatter(inputUrl, theme, mode);
testFunction(
url,
setupTest(url, page => page.assertNoAxeViolations())
);
});
findAllPages().forEach(inputUrl => {
const skipPages = [
...skip,
'theming/tokens',
// this page intentionally has issues to test the helper
'undefined-texts',
];
const testFunction = skipPages.includes(inputUrl) ? test.skip : test;
const url = urlFormatter(inputUrl, theme, mode);
testFunction(
url,
setupTest(url, page => page.assertNoAxeViolations())
);
});
});
}
2 changes: 1 addition & 1 deletion src/table/header-cell/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ export function TableHeaderCell<ItemType>({
[styles['header-cell-fake-focus']]: focusedComponent === `sorting-control-${String(columnId)}`,
})}
aria-label={
column.ariaLabel
column.ariaLabel && !sortingDisabled
? column.ariaLabel({
sorted: sorted,
descending: sorted && !!sortingDescending,
Expand Down

0 comments on commit ca6157d

Please sign in to comment.