React Testing Library · Module
queryByTestId
ByTestId queries find elements by their data-testid attribute. Use them after user-focused queries do not fit, and prefer them over DOM-structure or CSS-class selectors.
Last updated
Syntax
getByTestId(container, text, options?) : HTMLElementIn-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.
SubscribeRelated
getByTestIdqueryByTestIdgetAllByTestIdqueryAllByTestIdfindByTestIdfindAllByTestIdconfigurescreen