How to test react components

Can people share their experience of how to test react component please? Thanks

you might find this links interesting:

…using React’s testing addon will work with just about any testing tools (Tinytest, Gagarin, Chimp). But as you’ll read in the second article above, it only allows for “shallow” testing of components. For example, if you move elements out of a component into a child component, you won’t be able to test for the presence of that element in the component. For that you need to truly render to the DOM or a fake dom such as JSDOM.

1 Like

This is a great article too: