Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting isVisible to true with Jest, or else how to set ref? #43

Open
9bits opened this issue Apr 1, 2019 · 1 comment
Open

Setting isVisible to true with Jest, or else how to set ref? #43

9bits opened this issue Apr 1, 2019 · 1 comment

Comments

@9bits
Copy link

9bits commented Apr 1, 2019

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.

If it's not possible to set isVisible to true, how can I achieve my testing objectives?

@yemi
Copy link

yemi commented Sep 4, 2019

Having the same issue isVisible gets set to false and my test breaks due to logic being performed when !isVisible

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants