Open 9bits opened 5 years ago
Is it possible to set isVisible to true using Jest?
I want to be able to test whether my function is being called when the element is visible.
Setting the window.innerWidth and window.innerWidth doesn't work, and isVisible is still false.
window.innerWidth
isVisible
If it's not possible to set isVisible to true, how can I achieve my testing objectives?
Having the same issue isVisible gets set to false and my test breaks due to logic being performed when !isVisible
Is it possible to set isVisible to true using Jest?
I want to be able to test whether my function is being called when the element is visible.
Setting the
window.innerWidth
andwindow.innerWidth
doesn't work, andisVisible
is still false.If it's not possible to set
isVisible
to true, how can I achieve my testing objectives?