How does jest test react components that get data asynchronously?

there are mostly examples of testing static react or puppet components on the Internet, and there seems to be no example of testing components after getting data asynchronously. Do I understand the wrong test idea? Or is it the wrong way?

Jun.28,2021

Asynchronous requests are still implemented in the way of Mock. Jest has built-in mock methods (I'm not sure which one I'm using), or use third-party libraries, such as sinon


.

you're talking about container components. What do you want to test for container components?

do you want to test getting data asynchronously? I'm sure it's not, isn't it? This part is external dependency and should be mock off.

maybe you want to test the logic of the container component after data acquisition, then after mock, test the behavior of the container component (such as whether the properties passed to the self-component are correct), which is no different from testing the puppet component

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b2b601-2baa1.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b2b601-2baa1.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?