Skip to content

Instantly share code, notes, and snippets.

@DmytroShuba
Created September 15, 2021 16:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DmytroShuba/ecad99db8e269319665859387ecd1454 to your computer and use it in GitHub Desktop.
Save DmytroShuba/ecad99db8e269319665859387ecd1454 to your computer and use it in GitHub Desktop.
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