React Testing Library · Module
getByTitle
Use getByTitle to find an element with a matching title attribute. In React tests, render the component and call screen.getByTitle.
Last updated
Syntax
getByTitle(container: HTMLElement, title: TextMatch, options?: { exact?: boolean = true, normalizer?: NormalizerFn }): HTMLElementIn-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.
SubscribeRelated
queryByTitlegetAllByTitlequeryAllByTitlefindByTitlefindAllByTitlerenderscreen