Repository navigation
test(infinite-scroll): fix flaky top test in Safari - #31198
Open
darrenhalden537-lang wants to merge 2 commits into
Open
darrenhalden537-lang wants to merge 2 commits into
darrenhalden537-lang wants to merge 2 commits into
Conversation
|
Someone is attempting to deploy a commit to the Ionic Team on Vercel. A member of the Team first needs to authorize it. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
thetaPC
requested changes
Nov 19, 2026
Comment on lines
+14
to
+25
| /** | ||
| * Wait for the page to settle at its initial scroll | ||
| * position so scrolling to the top triggers the load. | ||
| */ | ||
| await expect | ||
| .poll(() => | ||
| content.evaluate(async (el: HTMLIonContentElement) => { | ||
| const scrollEl = await el.getScrollElement(); | ||
| return scrollEl.scrollTop; | ||
| }) | ||
| ) | ||
| .toBeGreaterThan(200); |
Contributor
There was a problem hiding this comment.
The 200 depends on the test page layout. The load triggers when scrollTop drops below the infinite scroll's height (84px min) plus threshold="100px", so 200 makes sure the content starts outside that zone. Without that in the comment, someone could change the threshold or the spinner and get a timeout that's hard to trace back here.
Suggested change
| /** | |
| * Wait for the page to settle at its initial scroll | |
| * position so scrolling to the top triggers the load. | |
| */ | |
| await expect | |
| .poll(() => | |
| content.evaluate(async (el: HTMLIonContentElement) => { | |
| const scrollEl = await el.getScrollElement(); | |
| return scrollEl.scrollTop; | |
| }) | |
| ) | |
| .toBeGreaterThan(200); | |
| /** | |
| * Wait for infinite scroll to move the content to the bottom | |
| * on load. The scroll must start outside the trigger zone | |
| * (infinite scroll height + 100px threshold) so that | |
| * scrolling to the top fires ionInfinite. | |
| */ | |
| await expect | |
| .poll(() => | |
| content.evaluate(async (el: HTMLIonContentElement) => { | |
| const scrollEl = await el.getScrollElement(); | |
| return scrollEl.scrollTop; | |
| }) | |
| ) | |
| .toBeGreaterThan(200); |
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue number: resolves #30423
What is the current behavior?
The
infinite-scroll: tope2e test is skipped in WebKit because it fails intermittently on CI. Withposition="top", the infinite scroll moves the content to the bottom in a write task after it loads. If the test callsscrollToTop(0)before that write task runs, the content is already at the top. Nothing scrolls, soionInfinitenever fires and the test times out.What is the new behavior?
Does this introduce a breaking change?
Other information
Only the test changed. Component behavior is the same.