heya :wave: . I'm writing a Composable that uses a...
# compose
v
heya 👋 . I'm writing a Composable that uses a
DisposableEffect
. What is the best way to test the invocation of this? Previously I've been using
Modifier.testTag(...)
to assert that a certain Composable is displayed, but this Modifier is not available on a
DisposableEffect
. To work around it, I tried also adding a
Spacer
that has a
testTag
set, but this doesn't seem to be working (the assertion that the spacer with the testTag is displayed is false). How can I test that a DisposableEffect has been invoked?
f
I don't have an answer to your question but for me it is similar question to "how to test that private method has been invoked". You shouldn't test the function itself but what the function does - how the state changes in result of invoking it.