I'm looking to do unit testing with react.js, d3 and mocha/chai. In order to integrate d3 with react.js, a lot of the d3 is done in componentDidMount since d3 cannot play very nicely with React's virtual DOM (similar to this http://nicolashery.com/integrating-d3js-visualizations-in-a-react-app/).
My question is how do I test the d3 functions? Is there a clean way I can wait for componentDidMount to complete before checking if the chart exists, etc.
Thanks!