JoĆ£o Silva
03/08/2024, 4:26 PMJoĆ£o Silva
03/08/2024, 4:27 PM@Test
fun primaryButtonPressed() {
composeTestRule.setTestContent {
TextButton(
onClick = { },
modifier = Modifier.testTag("tag")
) {
Text(text = "Button")
}
}
composeTestRule
.onNodeWithTag("tag")
.performTouchInput {
down(Offset.Zero)
}
.captureRoboImage()
}
Expected image is the first, what I actually get from roborazzi is the second.JoĆ£o Silva
03/08/2024, 4:28 PMdai
04/07/2024, 8:22 AMval interactionSource = remember { MutableInteractionSource() }
Button(onClick = {}, interactionSource = interactionSource) {
Text(text = "Label")
}
LaunchedEffect(Unit) {
interactionSource.emit(PressInteraction.Press(Offset(0f, 0f)))
}
JoĆ£o Silva
04/08/2024, 1:32 PM