A11y: enable rule jsx-a11y/aria-role (#55760)

This commit is contained in:
Laura Fernández 2022-09-27 10:55:16 +02:00 committed by GitHub
parent 2bfd26249b
commit 4544494058
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 4 deletions

View File

@ -47,7 +47,7 @@
"jsx-a11y/aria-activedescendant-has-tabindex": "error",
"jsx-a11y/aria-props": "error",
"jsx-a11y/aria-proptypes": "error",
"jsx-a11y/aria-role": "off",
"jsx-a11y/aria-role": "error",
"jsx-a11y/aria-unsupported-elements": "error",
"jsx-a11y/autocomplete-valid": "error",
"jsx-a11y/click-events-have-key-events": "off",

View File

@ -27,12 +27,11 @@ export const Filter: FC<Props> = ({ column, field, tableStyles }) => {
if (!field || !field.config.custom?.filterable) {
return null;
}
return (
<span
className={cx(tableStyles.headerFilter, filterEnabled ? styles.filterIconEnabled : styles.filterIconDisabled)}
ref={ref}
role="filterIcon"
role="button"
onClick={onShowPopover}
>
<Icon name="filter" />

View File

@ -200,7 +200,7 @@ describe('Table', () => {
expect(within(getTable()).getAllByRole('row')).toHaveLength(9);
await userEvent.click(within(getColumnHeader(/number/)).getByRole('filterIcon'));
await userEvent.click(within(getColumnHeader(/number/)).getByRole('button', { name: '' }));
await userEvent.click(screen.getByLabelText('1'));
await userEvent.click(screen.getByText('Ok'));