React Testing Library · Function
queryByRole
queryByRole finds one element by its ARIA role and optional filters such as accessible name. It returns null when there is no match, but throws when multiple elements match.
Last updated
Syntax
queryByRole(role, options?) -> HTMLElement | nullIn-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.
SubscribeRelated
getByRolegetAllByRolequeryAllByRolefindByRolefindAllByRolescreenwithin