Created
September 5, 2025 14:34
-
-
Save oliverspryn/448fbf52d5389a63bf46a6bb08884720 to your computer and use it in GitHub Desktop.
A custom assertion to check the role of a composable
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
fun SemanticsNodeInteraction.assertHasRole( | |
role: Role | |
): SemanticsNodeInteraction = assert( | |
SemanticsMatcher("The element has a role of $role") { | |
it.config.getOrNull(SemanticsProperties.Role) == role | |
} | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment