I had a composable, let’s call it
MyForm
that rendered several `TextField`s and a
Button
, like this:
TextField()
TextField()
TextField()
Button()
I was getting lucky that it was working in my app, because
MyForm
was being called from a parent that had a `Column`:
@Composable fun MyScreen() {
Column {
Header()
MyForm()
Footer()
}
}
But to test
MyForm
, it gets loaded on it’s own:
composeTestRule.setContent { MyForm() }
So in the test, all of those fields and the button are rendered on top of one another. In the end, the test can’t “focus” the first text field because it is underneath the button. 🤦
As soon as I put a
Column
IN
MyForm
, everything works like a champ