Created
March 13, 2026 20:11
-
-
Save LethalMaus/a2b0e094985a6ed9d168c74071c56bf8 to your computer and use it in GitHub Desktop.
Recomposition overlay test snippet for Android app startup article
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @RunWith(AndroidJUnit4::class) | |
| class MainScreenRecompositionOverlayTest { | |
| @get:Rule | |
| val composeRule = createAndroidComposeRule<ComponentActivity>() | |
| @Test | |
| fun overlay_expandShowsCounters_and_clearResetsRows() { | |
| assumeTrue(BuildConfig.DEBUG) | |
| composeRule.setContent { | |
| MainScreen(viewModel = MainViewModel()) | |
| } | |
| composeRule.onNodeWithText("Recompose show").performClick() | |
| composeRule.onNodeWithText("Clear").performClick() | |
| composeRule.onAllNodesWithText("TopBar:", substring = true).assertCountEquals(0) | |
| composeRule.onAllNodesWithText("ConnectivitySection:", substring = true).assertCountEquals(0) | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment