testing-library / dom-testing-library

🐙 Simple and complete DOM testing utilities that encourage good testing practices.
https://testing-library.com/dom
MIT License
3.26k stars 466 forks source link

Upgrade `aria-query` to version 5.2.1 #1239

Closed MatanBobi closed 6 months ago

MatanBobi commented 1 year ago

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.

philer-jambit commented 1 year ago

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

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.

MatanBobi commented 1 year ago

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!

philer-jambit commented 1 year ago

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.

cmorten commented 1 year ago

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

MatanBobi commented 6 months ago

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

The release is available on:

Your semantic-release bot :package::rocket: