Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
How to test Jetpack Compose - Layout
@Composable
fun MainScreen() {
Box(
contentAlignment = Alignment.Center,
modifier = Modifier
.fillMaxWidth()
.fillMaxHeight()
.background(Color.White)
) {
Button(
onClick = {...},
modifier = Modifier.testTag("yourTestTag")
) {
Text(text = stringResource(R.string.click))
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment