hey guys. can someone help me with unit tests in C...
# compose
n
hey guys. can someone help me with unit tests in Compose + Coil image loading? I answered my own question here and I would like to know if I’m doing right… https://stackoverflow.com/questions/73044642/how-to-unit-test-if-an-image-was-loaded-using-coil-compose/73080538#73080538
y
If you want to avoid special syntax in your composables to hang your tests off, you could use EventListener.
n
Sorry, could you elaborate?
y
If you set an event listener on your test image loader, you can just see that you get a success result after its rendered.
Just another option.
n
I got your point. My question is: how can I get the
painter
object in the test, listen to state changes and do the assertion with the success state?