test(recipes): add e2e tests for infinite-scroll recipe#3557
Open
itsjustriley wants to merge 4 commits intorecipe-test-setup-cleanfrom
Open
test(recipes): add e2e tests for infinite-scroll recipe#3557itsjustriley wants to merge 4 commits intorecipe-test-setup-cleanfrom
itsjustriley wants to merge 4 commits intorecipe-test-setup-cleanfrom
Conversation
Contributor
|
Oxygen deployed a preview of your
Learn more about Hydrogen's GitHub integration. |
5 tasks
|
🤖 Code Review · #projects-dev-ai for questions ✅ Complete - No issues 📋 History✅ No issues |
33d0b4f to
2819265
Compare
a71e9b1 to
068eb22
Compare
kdaviduik
previously requested changes
Mar 16, 2026
2e61d13 to
c93cac7
Compare
1cb21e1 to
02d05a3
Compare
c93cac7 to
ea7680a
Compare
…incomplete fixtures Recipe fixture generation now builds into a staging directory (.tmp suffix) and atomically renames to the final path only after install completes. Without this, parallel Playwright workers could see pathExists() === true on a fixture directory that was still mid-install, then launch a dev server against an incomplete node_modules tree.
…ection
Screen readers were announcing the "↑" and "↓" arrow characters in the
"Load previous" / "Load more" links as "up-pointing arrow" / "down-pointing
arrow", adding noise to the navigation experience.
Wraps each arrow in <span aria-hidden="true"> so they remain visible
but are excluded from the accessible name. Also fixes JSDoc grammar
("encapsulate" → "encapsulates").
Adds 8 Playwright tests validating the infinite-scroll recipe's collection page behavior against the preview storefront fixture store. Coverage: - Initial product loading and "Load more" button visibility - Manual load-more interaction (product count increase + URL param update) - Direct URL navigation — simulates a shared link to "page 2" and verifies the "Load previous" link appears (no accumulated location.state) - Automatic loading via Intersection Observer when scrolling load-more into view - History replace mode (no history length growth after scroll-triggered load) - Scroll position preservation across pagination loads Key design decisions: - Viewport constrained to 400px height (SCROLL_TEST_VIEWPORT) for scroll tests so the load-more button reliably starts below the fold on any CI runner - InfiniteScrollUtil fixture hides URL polling, locator details, and param knowledge behind named methods (waitForUrlToContainPaginationParam, etc.) - Custom poll error messages for CI debuggability - Shared-link test captures a real paginated URL via load-more cycle rather than hardcoding a cursor value
02d05a3 to
a6440e0
Compare
kdaviduik
reviewed
Mar 19, 2026
cookbook/recipes/infinite-scroll/patches/collections.$handle.tsx.f062a9.patch
Show resolved
Hide resolved
cookbook/recipes/infinite-scroll/patches/collections.$handle.tsx.f062a9.patch
Show resolved
Hide resolved
so that if this gets an approval from Freddie tomorrow before I start work you'll be able to merge this (remaining blockers are trivial)
Why: PR review identified four issues — a missing changeset package, an orphaned patch file, a vacuously-passing scroll assertion, and a grammatically broken JSDoc comment. How: - Add missing @shopify/create-hydrogen to changeset (required by skeleton bundling chain rules) - Delete orphaned package.json.f30b0a.patch (recipe.yaml references acbf33, not f30b0a) - Add expect(initialScrollY).toBeGreaterThan(0) precondition to the scroll-preservation test so it fails loudly if scrollIntoViewIfNeeded() silently no-ops - Rewrite changeset description to accurately reflect the aria-hidden change (not the landmark addition) - Fix JSDoc grammar: "encapsulates how the previous and next behaviors" → "encapsulates the previous and next pagination behaviors"
andguy95
approved these changes
Mar 19, 2026
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.
WHY are these changes introduced?
Adds e2e tests for the infinite-scroll recipe, building on the recipe testing infrastructure from #3492.
WHAT is this pull request doing?
Tests cover:
Note on PreviousLink: The recipe includes a PreviousLink component, but it's not tested because infinite scroll accumulates products forward (1-8, then 1-16, then 1-24...). There's no "previous page" in typical infinite scroll UX - users scroll up to see earlier products. The PreviousLink would only appear when manually navigating to cursor-based URLs.
HOW to test your changes?
```bash
pnpm run build
npx playwright test e2e/specs/recipes/infinite-scroll.spec.ts --project=recipes --workers=1
```
All 7 tests should pass.
Checklist