Skip to main content

All Questions

Filter by
Sorted by
Tagged with
3 votes
1 answer
2k views

How to write a test for conditional rendering component depended on useState hook in React?

I'm trying to write a test for my functional component, but don't understand how to mock isRoomsLoaded to be true, so I could properly test my UI. How and what do I need to mock? import React, { ...
Simeon Johns's user avatar