Hey guys. I have a question about Compose testing. My test has a
LaunchedEffect
which will change a state after a delay and trigger a recomposition. I want to wait for the end of the consequent recomposition and then do some assertions. How can I achieve the waiting?
waitForIdle
doesn’t work.
a
Albert Chang
06/14/2022, 1:26 PM
Have you tried
rule.mainClock.advanceTimeBy()
?
f
fengdai
06/14/2022, 1:41 PM
I've tried
waitUntil
to wait for the state changing. And I known the recomposition happens after that. If I use
advanceTimeBy
after the
waitUntil
. What's the appropriate time for it, so I can reach the end of the recomposition?