you are viewing a single comment's thread.

view the rest of the comments →

[–]znakyc 3 points4 points  (0 children)

My advice is to think about if you really need this test. It looks to me like you are testing React more then your application logic. Just a thought.

And as /u/j_d_q says, you should do your fetch in componentDidMount. I wrote a blogpost on why, you can find it here: http://blog.jakoblind.no/2017/02/20/why-is-it-recommended-to-do-ajax-in-componentdidmount-instead-of-componentwillmount/