Anyone knows how to test a composable with `.testT...
# compose-android
a
Anyone knows how to test a composable with
.testTag
that is part of another composable that gets called by a top level composable which gets called in
MainActivity
? I get an error stating said tagged composable is in the subtree and not in the main one used for discovering nodes.
E.g.
Copy code
@Composable
fun TopLevelComposable() {
    AComposable()
}
Copy code
@Composable
fun AComposable() {
    Text(text = "stringOfText", modifier = Modifier.testTag("Text of AComposable"))
}
Testing
Text(...)
throws error.
Specifically, I'm get the following error:
Copy code
java.lang.AssertionError: Failed: assertExists.
Reason: Expected exactly '1' node but could not find any node that satisfies: (TestTag = '<STRING HERE>')
However, the unmerged tree contains '1' node that matches. Are you missing `useUnmergedNode = true` in your finder?