Testing

findByRole

Asynchronous query that retries until one match is found or timeout occurs.

Formal Syntax & Structure

react syntaxreact
await screen.findByRole("alert")

Working Example

Example Snippetreact
await screen.findByRole("alert")
React Reference