Is it possible to assert that a jetpack compose node is scrollable when performing tests?
class MyTest {
@get:Rule
val composeTestRule = createComposeRule()
@Test
fun givenEnoughItems_thenAssertListIsScrollable() {
composeTestRule.setContent {
BasicTheme {
ScrollableComponent(items = List(1000) { "$it" })
}
}
composeTestRule.onRoot().fetchSemanticsNode().assertIsScrollable()
}
}
fun SemanticsNodeInteraction.assertIsScrollable() : SemanticsNodeInteraction {
// What would go here?
}