Marcin Środa
04/21/2021, 12:02 PMMarcin Środa
04/21/2021, 12:05 PM@Test
fun MyTest() {
// Start the app
composeTestRule.setContent {
MyAppTheme {
MainScreen(uiState = exampleUiState, /*...*/)
}
}
composeTestRule.onNodeWithText("Continue").performClick()
composeTestRule.onNodeWithText("Welcome").assertIsDisplayed()
}
Let’s say I want to create a global provider, which provides an instance to the tree of components, and I want to test it. Ofc I can do it this way:
@Test
fun MyTest() {
composeTestRule.setContent {
MyProvider {
Assert.assertEquals(expected, LocalAwesomeSomething)
}
}
}
but what if I want to do similar given, when, then approach? Am I able to check the local composition in child?