leapchat
leapchat copied to clipboard
Consider using enzyme for React testing
https://github.com/airbnb/enzyme#basic-usage
@jimmcgaw Thoughts?
Thanks for making the issue. Going beyond unit tests and testing the components themselves is definitely on my radar, and enzyme is the de facto choice for these kinds of tests. Much more lightweight than firing up an entire browser in selenium.
I was thinking of re-orging the components a bit (I'm not convinced the nesting still makes sense) and refactoring most of them to presentational ones before doing this.
@jimmcgaw Which component nesting doesn't make sense, and what's the alternative(s)?
I haven't dug into it. I remember glancing over MessageBox, MessageList, Message, ChatContainer, and so, and I feel like I just threw them together. The more I think about this, the more I think that adding tests will force me to make better component design decisions and rework accordingly. And refactoring is a better idea with existing test coverage.
Tests; sounds good. I need to get into the habit of writing way more tests.