Created
April 4, 2022 07:20
-
-
Save parthdesai1208/fe289fd0b12e56be66b2137092bd1394 to your computer and use it in GitHub Desktop.
Compose testing
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
****************************************************************************************************************************************** | |
ex-1 | |
statement = here, we want to test that, from 3 tabs, whatever value is set for current screen so according that same tab should selected. | |
****************************************************************************************************************************************** | |
passed case) | |
@get:Rule | |
val composeTestRule = createComposeRule() | |
@Test | |
fun rallyTopAppBarTest() { | |
val allScreens = RallyScreen.values().toList() | |
composeTestRule.setContent { | |
RallyTopAppBar( | |
allScreens = allScreens, | |
onTabSelected = { /*TODO*/ }, | |
currentScreen = RallyScreen.Accounts | |
) | |
} | |
composeTestRule.onNodeWithContentDescription(RallyScreen.Accounts.name) //pass Bill instead of Accounts for "failed" case | |
.assertIsSelected() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment