Skip to content

On the "About Queries" page, prefer links to external guides over external specifications. #1286

Open
@DanKaplanSES

Description

@DanKaplanSES

Is your feature request related to a problem? Please describe.
As a novice at writing accessible HTML, the testing-library documentation was straightforward until I reached the "About Queries" page. To be specific, the links in the Priority section's getByRole paragraph initially overwhelmed me, and I'd like to propose an idea that may help others like me in the future.

Here's an list of each link in the paragraph and a context relevant description:

  1. The accessibility tree link goes to a reference page that forks off to many more reference pages and specifications.
  2. The accessible name link goes to a 10+ page specification written in abstract language. The primary audience appears to be browser developers, not web developers.
  3. The list of roles forks off to more reference pages and specifications than the previous two.

As far as I can tell, none of these links directly show how to use the HTML role attribute. They seem more about accessibility in general.

Describe the solution you'd like
W3.org provides guides on some of these concepts (e.g., https://www.w3.org/WAI/ARIA/apg/practices/names-and-descriptions/#naming_role_guidance ) written in relatively easy language. Even better, link to an article focused entirely on explaining the HTML role attribute. Ideally, the article would contain lots of examples.

Describe alternatives you've considered

  1. The end of the getByRole paragraph already includes an example, but in my humble opinion, it should also include the HTML of the queried button. Actually, I think this should be done in addition to the solution described above.
  2. To be honest, I think the documentation would improve if links 1 and 2 were removed and nothing else changed. Whether intended or not, they imply, "if you're unfamiliar with these concepts, here's where you should start." But personally, I think there are better places to start. If those links weren't there, I would have opened a new tab and found a user-friendly guide on these concepts.

Additional context
Apologies if this comes off complain-y. That's not my intention: I want to increase testing-library's adoption by reducing its learning curve. Oh, and I'm not personally struggling with anything I mentioned (anymore). I wrote this to help the next person that starts where I started.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions