-
-
Save eevajonnapanula/e029a258a473307fd1d2fd0d8a737d30 to your computer and use it in GitHub Desktop.
This file contains 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
class ToggleableTest { | |
@get:Rule | |
val composeTestRule = createComposeRule() | |
@Test | |
fun hasRoleNameValue() { | |
composeTestRule.setContent { | |
ModifiersExampleTheme { | |
ToggleableScreen() | |
} | |
} | |
val toggleableElement = | |
composeTestRule.onNode(hasTestTag("accessible-toggle")) | |
// Assert accessible name | |
toggleableElement.assertTextEquals("Toggleable") | |
// Assert role | |
toggleableElement.assertIsToggleable() | |
// Assert value | |
toggleableElement.assertIsOff() | |
toggleableElement.performClick() | |
toggleableElement.assertIsOn() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment