Zach Klippenstein (he/him) [MOD]
02/05/2021, 4:07 PMAndroidComposeTestRule
assertions? Example in thread.Zach Klippenstein (he/him) [MOD]
02/05/2021, 4:09 PMval composeRule = createAndroidComposeTestRule(…)
@Test fun compositionDisappears() {
// Adds a ComposeView to the view tree.
setupComposeUi()
composeRule.onNodeWithText("expected text").assertIsDisplayed()
// Removes the ComposeView from the view tree entirely.
tearDownComposeUi()
// This line fails on alpha11 because no Compose views are found.
composeRule.onNodeWithText("expected text").assertDoesNotExist()
}
Zach Klippenstein (he/him) [MOD]
02/05/2021, 4:11 PMEspresso.onView(isInstanceOf(ComposeView::class.java)).check(exists())
or whatever manually, since the fact that the view is torn down by removing the Compose view entirely vs just composing empty content is an implementation detail.Zach Klippenstein (he/him) [MOD]
02/05/2021, 4:13 PMZach Klippenstein (he/him) [MOD]
02/05/2021, 4:35 PM