Skip to content

test({react,preact}-query/usePrefetchInfiniteQuery): inline the shared 'Suspended' component into each test#11078

Merged
sukvvon merged 1 commit into
mainfrom
test/inline-suspended-infinite-component-per-test
Jul 18, 2026
Merged

test({react,preact}-query/usePrefetchInfiniteQuery): inline the shared 'Suspended' component into each test#11078
sukvvon merged 1 commit into
mainfrom
test/inline-suspended-infinite-component-per-test

Conversation

@sukvvon

@sukvvon sukvvon commented Jul 18, 2026

Copy link
Copy Markdown
Member

🎯 Changes

Inlines the describe-level shared Suspended component into each it block as a local Page component, so each test reads as self-contained (the hook call and rendered pages it exercises are visible in the test itself rather than in a shared generic helper). Removes the now-unused InfiniteData/UseSuspenseInfiniteQueryOptions type imports that only backed the shared component's generic signature. Applies to both react-query and preact-query.

✅ Checklist

  • I have followed the steps in the Contributing guide.
  • I have tested this code locally with pnpm run test:pr.

🚀 Release Impact

  • This change affects published code, and I have generated a changeset.
  • This change is docs/CI/dev-only (no release).

Summary by CodeRabbit

  • Tests
    • Refactored infinite-query suspense tests for clearer, more direct coverage.
    • Preserved validation of page rendering, suspense behavior, and fetching subsequent pages.

@nx-cloud

nx-cloud Bot commented Jul 18, 2026

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit cc52930

Command Status Duration Result
nx affected --targets=test:sherif,test:knip,tes... ✅ Succeeded 4m 33s View ↗
nx run-many --target=build --exclude=examples/*... ✅ Succeeded 42s View ↗

☁️ Nx Cloud last updated this comment at 2026-07-18 09:20:00 UTC

@github-actions

Copy link
Copy Markdown
Contributor

🚀 Changeset Version Preview

No changeset entries found. Merging this PR will not cause a version bump for any packages.

@coderabbitai

coderabbitai Bot commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: fa285048-10ec-45dc-b912-a5b0aefcf1d9

📥 Commits

Reviewing files that changed from the base of the PR and between b955f60 and cc52930.

📒 Files selected for processing (2)
  • packages/preact-query/src/__tests__/usePrefetchInfiniteQuery.test.tsx
  • packages/react-query/src/__tests__/usePrefetchInfiniteQuery.test.tsx

📝 Walkthrough

Walkthrough

Changes

Suspense test refactor

Layer / File(s) Summary
Remove shared suspense helper
packages/*-query/src/__tests__/usePrefetchInfiniteQuery.test.tsx
The generic Suspended component and its unused infinite-query type imports are removed.
Inline per-test page components
packages/*-query/src/__tests__/usePrefetchInfiniteQuery.test.tsx
Each affected test defines a local Page component using useSuspenseInfiniteQuery and renders it within the existing suspense and prefetch boundaries.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly matches the main test refactor: inlining the shared Suspended component in react-query and preact-query.
Description check ✅ Passed The description follows the template with Changes, Checklist, and Release Impact sections filled in and aligned to the PR.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch test/inline-suspended-infinite-component-per-test

Comment @coderabbitai help to get the list of available commands.

@pkg-pr-new

pkg-pr-new Bot commented Jul 18, 2026

Copy link
Copy Markdown
More templates

@tanstack/angular-query-experimental

npm i https://pkg.pr.new/@tanstack/angular-query-experimental@11078

@tanstack/eslint-plugin-query

npm i https://pkg.pr.new/@tanstack/eslint-plugin-query@11078

@tanstack/lit-query

npm i https://pkg.pr.new/@tanstack/lit-query@11078

@tanstack/preact-query

npm i https://pkg.pr.new/@tanstack/preact-query@11078

@tanstack/preact-query-devtools

npm i https://pkg.pr.new/@tanstack/preact-query-devtools@11078

@tanstack/preact-query-persist-client

npm i https://pkg.pr.new/@tanstack/preact-query-persist-client@11078

@tanstack/query-async-storage-persister

npm i https://pkg.pr.new/@tanstack/query-async-storage-persister@11078

@tanstack/query-broadcast-client-experimental

npm i https://pkg.pr.new/@tanstack/query-broadcast-client-experimental@11078

@tanstack/query-core

npm i https://pkg.pr.new/@tanstack/query-core@11078

@tanstack/query-devtools

npm i https://pkg.pr.new/@tanstack/query-devtools@11078

@tanstack/query-persist-client-core

npm i https://pkg.pr.new/@tanstack/query-persist-client-core@11078

@tanstack/query-sync-storage-persister

npm i https://pkg.pr.new/@tanstack/query-sync-storage-persister@11078

@tanstack/react-query

npm i https://pkg.pr.new/@tanstack/react-query@11078

@tanstack/react-query-devtools

npm i https://pkg.pr.new/@tanstack/react-query-devtools@11078

@tanstack/react-query-next-experimental

npm i https://pkg.pr.new/@tanstack/react-query-next-experimental@11078

@tanstack/react-query-persist-client

npm i https://pkg.pr.new/@tanstack/react-query-persist-client@11078

@tanstack/solid-query

npm i https://pkg.pr.new/@tanstack/solid-query@11078

@tanstack/solid-query-devtools

npm i https://pkg.pr.new/@tanstack/solid-query-devtools@11078

@tanstack/solid-query-persist-client

npm i https://pkg.pr.new/@tanstack/solid-query-persist-client@11078

@tanstack/svelte-query

npm i https://pkg.pr.new/@tanstack/svelte-query@11078

@tanstack/svelte-query-devtools

npm i https://pkg.pr.new/@tanstack/svelte-query-devtools@11078

@tanstack/svelte-query-persist-client

npm i https://pkg.pr.new/@tanstack/svelte-query-persist-client@11078

@tanstack/vue-query

npm i https://pkg.pr.new/@tanstack/vue-query@11078

@tanstack/vue-query-devtools

npm i https://pkg.pr.new/@tanstack/vue-query-devtools@11078

commit: cc52930

@github-actions

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size
react full 12.13 KB (0%)
react minimal 9.08 KB (0%)

@sukvvon sukvvon self-assigned this Jul 18, 2026
@sukvvon
sukvvon merged commit 10770f0 into main Jul 18, 2026
9 checks passed
@sukvvon
sukvvon deleted the test/inline-suspended-infinite-component-per-test branch July 18, 2026 12:10
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.

1 participant