Skip to content

getByRole should accept a second argument to refine query as in react-testing-library #827

Closed
@leoparis89

Description

@leoparis89

Describe the Feature

Should be able to query a Button element as follows:

getByRole('button', {name: /submit/i})

At the present time, this is impossible so I have to add redundant accessiblityLabel props, for example:

<Button accessibilityLabel="submit-button">Submit</Button>

And then, use queryByA11yLabel('submit-button')

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions