I'm Kent C. Dodds. I help people make the world better through quality software. Ask me anything!View other answers to this thread
Learn Something New Everyday,
Connect With The Best Developers!
Hi Kent, I have tweeted this question: How to deal with testing UI components where styles have to be verified? I'm completely against checking classes of a DOM node. Would you recommend checking styles instead?
Say a button component is to be tested. Like bootstrap, lets say, there are N variants of button based on the props passed viz. primary, alert, info... How about testing this? Can you please more insights on this?
Styles are all about the way the component looks. You can't test that reliably without visual regression testing tools. So if you need confidence that the look of your components remains unchanged, I recommend you take a look Applitools or Percy. Good luck!