kentcdodds / testing-react-apps

A workshop for testing react applications
https://www.epicreact.dev/modules/testing-react-apps-v1/testing-react-apps-welcome
Other
1.07k stars 719 forks source link

Exercice 6: use waitForElementToBeRemoved instead of manual await #58

Closed ValentinH closed 3 years ago

ValentinH commented 3 years ago

This is a follow-up after a discussion on Discord.

In exercice 6, we need to use act(). When doing the exercice, I used waitForElementToBeRemoved(). Isn't this better than manually awaiting for the promise? Maybe, waiting for the promise in this lesson was for introducing when/how to use act() ? image

If you change it, it might also impact the "extra credit 1" as there is no promise there and act is used.

kentcdodds commented 3 years ago

I'll make sure to do this in the updated version 👍

kentcdodds commented 3 years ago

This update has happened in the next branch 👍