React Testing Library · Function
getByPlaceholderText
getByPlaceholderText finds one element whose placeholder attribute matches the given text. In React Testing Library, use it through screen after rendering a component.
Last updated
Syntax
getByPlaceholderText(container: HTMLElement, text: TextMatch, options?: { exact?: boolean; normalizer?: NormalizerFn }): HTMLElementIn-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.
SubscribeRelated
queryByPlaceholderTextgetAllByPlaceholderTextqueryAllByPlaceholderTextfindByPlaceholderTextfindAllByPlaceholderTextgetByLabelTextscreenwithin