-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
how would I test an event that causes the page to scroll? #202
Comments
@lostrouter Did you have any luck with this? I'm trying the same thing. My problem seems to be that window.innerHeight is only 300, so window.scrollTo has no effect. |
i didn't get anywhere with this and am falling back to testing in browser. |
Thank you for reporting this issue and appreciate your patience. We've notified the core team for an update on this issue. We're looking for a response within the next 30 days or the issue may be closed. |
You might be able to just directly set |
I would do it with a fake container instead of |
Well, here you have a couple of options...
I think the second way is good enough, since you code actually "does not care" about what scrollTo does internally, you just need to test that you are calling that method when the click event happens. I hope this helps :) |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
I am trying to test for a click event causing a page scroll. I am trying this, and it is passing when i remove the click simulation. What am i not doing in the test?
React component
Jest Test
The text was updated successfully, but these errors were encountered: