Skip to content

Instantly share code, notes, and snippets.

@igorescodro
Last active February 24, 2021 14:52
Show Gist options
  • Save igorescodro/9695f32d227d4f25b631924357ea0b33 to your computer and use it in GitHub Desktop.
Save igorescodro/9695f32d227d4f25b631924357ea0b33 to your computer and use it in GitHub Desktop.
Compose tests
internal class MyComposableTest {
@get:Rule
val composeTestRule = createComposeRule()
@Before
fun setup() {
composeTestRule.setContent {
MyTheme {
MyComposable()
}
}
}
@Test
fun test_TitleIsShown() {
composeTestRule.onNodeWithText("Title").assertIsDisplayed()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment