for unit testing, the "virtual dom" or whatever yo...
# compose
p
for unit testing, the "virtual dom" or whatever you want to call it could be the key to success
a
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
yeap, you'd need testing tooling around to be able to just ask for part of the implementation as Enzyme does for React
a
yeah, which gets a lot more interesting as you start flattening that tree, or start from a pretty flat tree to begin with