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

Fix 4908 - InfiniteScroll test timing and call to scrollIntoView #4913

Merged
merged 1 commit into from
Feb 2, 2021

Conversation

halocline
Copy link
Collaborator

What does this PR do?

Closes #4908 by adding timers to Jest test, plus mocking scrollIntoView function which is called in some InfiniteScroll + show scenarios, but is not supported by JSDOM.

Where should the reviewer start?

InfiniteScroll-test.js

What testing has been done on this PR?

Jest tests.

Re: reliably reproducing issue - The issue was intermittent because the timer calling scrollIntoView could be longer than the duration of the test. Reducing the timeout duration allowed consistent reproduction, followed by use of Jest timers.

How should this be manually tested?

Any background context you want to provide?

There is quite a bit of discussion on the JSDOM project about how to test components relying on the scroll APIs jsdom/jsdom#1695 (comment).

What are the relevant issues?

#4908

Screenshots (if appropriate)

Do the grommet docs need to be updated?

No.

Should this PR be mentioned in the release notes?

No.

Is this change backwards compatible or is it a breaking change?

Backwards compatible.

@ShimiSun ShimiSun merged commit c4cf694 into grommet:master Feb 2, 2021
@halocline halocline deleted the fix-4908 branch August 2, 2021 15:44
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

Successfully merging this pull request may close these issues.

InfiniteScroll tests fail due to race conditions
2 participants