React Testing Library · Module
findByLabelText
getByLabelText finds the form control associated with matching label text. It supports common label relationships and can be called as screen.getByLabelText in React Testing Library.
Last updated
Syntax
getByLabelText(container: HTMLElement, text: TextMatch, options?: { selector?: string, exact?: boolean, normalizer?: NormalizerFn }): HTMLElementIn-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.
SubscribeRelated
getByRolequeryByLabelTextgetAllByLabelTextqueryAllByLabelTextfindByLabelTextfindAllByLabelTextscreen