You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description
When paparazzi's injected lifecycle is used for launching an animation with a frame clock, the UI stops recomposing in subsequent tests. Since paparazzi shares the same renderer instance across all tests, could some important state be failing to reset correctly?
Steps to Reproduce
When the two tests in the following code are run, they'll produce two animated snapshots using identical code. The first one will display an animated counter whereas the second one will remain stuck at 0.
class FooTest {
@get:Rule
val paparazzi = Paparazzi()
@Test fun first() {
takeSnapshot()
}
@Test fun second() {
takeSnapshot()
}
private fun takeSnapshot() {
paparazzi.gif {
val counter by produceState(initialValue = 0) {
while (isActive) {
delay(100)
this.value += 1
println("writing value = ${this.value}")
}
}
SideEffect {
println("reading value = $counter")
}
val lifecycleOwner = LocalLifecycleOwner.current
DisposableEffect(Unit) {
val animatable = Animatable(0f)
onDispose {
lifecycleOwner.lifecycle.coroutineScope.launch {
withContext(AndroidUiDispatcher.Main) {
animatable.animateTo(1f)
}
}
}
}
Text(
modifier = Modifier
.fillMaxSize()
.background(Color(0xFF073858))
.padding(16.dp),
text = "Counter = $counter",
color = Color.Yellow,
)
}
}
}
Description
When paparazzi's injected lifecycle is used for launching an animation with a frame clock, the UI stops recomposing in subsequent tests. Since paparazzi shares the same renderer instance across all tests, could some important state be failing to reset correctly?
Steps to Reproduce
When the two tests in the following code are run, they'll produce two animated snapshots using identical code. The first one will display an animated counter whereas the second one will remain stuck at
0
.Additional information:
The text was updated successfully, but these errors were encountered: