Testing · Junior · Question 48 of 78
Which query should you use for an element that appears after data loads?
- ✓Correct answer:
await screen.findByText("Ann") - 2
screen.getByText("Ann")immediately afterrender - 3
screen.queryByText("Ann")in a loop
Explanation
findBy retries the query until the element appears or the timeout (1000 ms by default) runs out.