How to test LazyColumn items? Looks like items are...
# compose
m
How to test LazyColumn items? Looks like items are not wrapped. See thread …
Copy code
Printing with useUnmergedTree = 'false'
    Node #2 at (l=0.0, t=210.0, r=1080.0, b=1251.0)px
    ContentDescription = '[message_list]'
    CollectionInfo = 'androidx.compose.ui.semantics.CollectionInfo@9b2348e'
    Actions = [IndexForKey, ScrollToIndex]
     |-Node #4 at (l=21.0, t=1095.0, r=147.0, b=1221.0)px
     | ContentDescription = '[profile_image]'
     | Actions = [OnClick]
     | MergeDescendants = 'true'
     |-Node #6 at (l=168.0, t=1095.0, r=345.0, b=1152.0)px
     | Text = '[John Doe]'
     | Actions = [GetTextLayoutResult]
     |-Node #8 at (l=358.0, t=1107.0, r=434.0, b=1150.0)px
     | Text = '[01:00]'
     | Actions = [GetTextLayoutResult]
     |-Node #10 at (l=168.0, t=1152.0, r=507.0, b=1251.0)px
     |  |-Node #11 at (l=189.0, t=1173.0, r=486.0, b=1230.0)px
     |    Text = '[Test Message 1]'
     |    Actions = [GetTextLayoutResult]
     |-Node #13 at (l=21.0, t=918.0, r=147.0, b=1044.0)px
     | ContentDescription = '[profile_image]'
     | Actions = [OnClick]
     | MergeDescendants = 'true'
     |-Node #15 at (l=168.0, t=918.0, r=345.0, b=975.0)px
     | Text = '[John Doe]'
     | Actions = [GetTextLayoutResult]
     |-Node #17 at (l=358.0, t=930.0, r=434.0, b=973.0)px
     | Text = '[01:00]'
     | Actions = [GetTextLayoutResult]
     |-Node #19 at (l=168.0, t=975.0, r=507.0, b=1074.0)px
     |  |-Node #20 at (l=189.0, t=996.0, r=486.0, b=1053.0)px
     |    Text = '[Test Message 2]'
     |    Actions = [GetTextLayoutResult]
What you can see is that there’s no parent node for item
r
Good question. It seems there is currently no way to assert for example number of items, because it counts all the elements inside items
f
hey, how do you print the tree like that?
m
printToLog()
or similar question - how to test onClick on items in
LazyColumn
? Let’s say I have a Row with clickable modifier. How to test it? (row is not showing when using
printToLog
ofc)
@Ian Lake do you know anyone who can answer this question?