Testing · Middle · Question 3 of 75
How do you wait for a loading spinner to disappear?
- ✓Correct answer:
await waitForElementToBeRemoved(() => screen.queryByRole("progressbar")) - 2
await screen.findByRole("progressbar") - 3
expect(screen.getByRole("progressbar")).toBeNull()
Explanation
The helper requires the element to be present at the start, then waits until the query returns null.