https://kotlinlang.org logo
#compose
Title
# compose
p

Pedro Gomez

05/21/2019, 1:03 PM
for unit testing, the "virtual dom" or whatever you want to call it could be the key to success
a

Adam Powell

05/21/2019, 1:10 PM
It's certainly in the plan to be able to interrogate a composed tree for testing, the types of questions you can ask it are what I'd like to be careful with to avoid brittle tests. If you're testing a NewsStoryCard that includes a HeadlineSnippet with two bits of text, it doesn't matter if HeadlineSnippet changes its implementation from two Text elements in a Column to a single Text element with a newline, for example. That sort of change ideally wouldn't break HeadlineCard tests.
👍 1
p

Pedro Gomez

05/21/2019, 1:14 PM
yeap, you'd need testing tooling around to be able to just ask for part of the implementation as Enzyme does for React
a

Adam Powell

05/21/2019, 1:16 PM
yeah, which gets a lot more interesting as you start flattening that tree, or start from a pretty flat tree to begin with
7 Views