React Testing Library · Function
queryByText
queryByText checks for an element by its text. It returns the element, null for no match, and throws when multiple elements match.
Last updated
Syntax
queryByText(text, options?)In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.
SubscribeRelated
getByTextgetAllByTextqueryAllByTextfindByTextfindAllByTextscreenwithin