Skip to content

Name property does not exist in ByRoleOptions typing #636

Closed
@eric-burel

Description

@eric-burel
  • @testing-library/react version: 10.0.2

Relevant code or config:

Name is documented here: https://testing-library.com/docs/dom-testing-library/api-queries#byrole

But absent from the "ByRole" typing.

What you did:

const checkbox2 = getByRole("checkbox", { name: "asset-2" });

What happened:

Argument of type '{ name: string; }' is not assignable to parameter of type 'ByRoleOptions'.
Object literal may only specify known properties, and 'name' does not exist in type 'ByRoleOptions'.ts(2345)

Reproduction:

Use getByRole in a ts file like in the code provided above.

Suggested solution:

Fix typings of the ByRole option

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