dom-testing-library icon indicating copy to clipboard operation
dom-testing-library copied to clipboard

Upgrade `aria-query` to version 5.2.1

Open MatanBobi opened this issue 1 year ago • 4 comments

Describe the feature you'd like:

aria-query has released a new version yesterday which caused some regression on our end. At the moment, we've pinned the version to prevent issues, we need to upgrade it soon to be compliant with the new ARIA spec changes. Affected issues that were closed in the meantime because we've pinned the version: https://github.com/testing-library/dom-testing-library/issues/1235 https://github.com/testing-library/dom-testing-library/issues/1238

Teachability, Documentation, Adoption, Migration Strategy:

We need to upgrade locally, see which tests are failing and why, if aria-query has issues, we need to open issues in their repo.

MatanBobi avatar Jun 14 '23 21:06 MatanBobi

The current pin (aria-query: 5.1.3) causes some of our tests to fail, in particular:

  • an <input type"text" list="my-options" … /> which references a <datalist id="my-options"> is no longer accessible as role="textbox" but role="combobox" instead
  • an <input type="date" /> which was previously accessible as role="textbox" now has no role at all.

Note that we are using @testing-library/cypress, which still uses the outdated @testing-library/dom version ^8.1.0.

As a temporary workaround we have pinned "@testing-library/dom": "8.20.0" in our dependencies.

philer-jambit avatar Jun 19 '23 09:06 philer-jambit

Hi @philer-jambit, thanks for posting this. The behavior you're seeing in 5.1.3 is correct and follows the spec so you'll probably need to adapt your tests:

  1. An input with type="text" and a list attribute should be accessible through role="combobox": image

  2. Input type="date" has no corresponding implicit role: image

More about this can be found in the ARIA spec. Thanks again!

MatanBobi avatar Jun 20 '23 06:06 MatanBobi

Good to know, thanks! :+1:

I have to say, date inputs not having any role of their own and the spec forbidding adding a role is quite impractical. Firefox's accessibility inspector actually calls it date editor, but evidently that is non-standard. For lack of a better idea I've now resorted to data-testid.

philer-jambit avatar Jun 20 '23 08:06 philer-jambit

A new version https://www.npmjs.com/package/aria-query/v/5.3.0, it would be good to see if this resolves the issues with 5.2.1

cmorten avatar Jun 24 '23 22:06 cmorten

:tada: This issue has been resolved in version 10.0.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

MatanBobi avatar Apr 08 '24 13:04 MatanBobi