Skip to content

getByRole does not work with "term" #703

Closed
@supervanya

Description

@supervanya
  • Testing Framework and version:

@testing-library/react: 10.4.4

jest: 24.9.0

  • DOM Environment:

@testing-library/jest-dom: ^5.11.0

Relevant code or config:

const dt = screen.getAllByRole("term");

What you did:

I was trying to get dt elements by role ("term")

What happened:

I am getting an error:
Unable to find an accessible element with the role "term"
(more info in the sandbox)

Reproduction:

https://codesandbox.io/s/react-testing-library-demo-skxjh?file=/src/__tests__/hello.js

Problem description:

term is one of the accessible roles as stated on w3 here
It used to work in the @testing-library/react: 10.2.1 but broke in 10.3.0

Suggested solution:

I am a pretty new front end developer and unfortunately don't have a solution but I would really appreciate any help and I could possibly try to create a PR (never done this before though)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions