Skip to content

test({react,preact,solid}-query/useInfiniteQuery): inline the shared 'fetchItems' helper into the tests that use it#11082

Merged
sukvvon merged 1 commit into
mainfrom
test/inline-fetchitems-useinfinitequery
Jul 19, 2026
Merged

test({react,preact,solid}-query/useInfiniteQuery): inline the shared 'fetchItems' helper into the tests that use it#11082
sukvvon merged 1 commit into
mainfrom
test/inline-fetchitems-useinfinitequery

Conversation

@sukvvon

@sukvvon sukvvon commented Jul 19, 2026

Copy link
Copy Markdown
Member

🎯 Changes

Inlines the fetchItems helper (a plain async mock queryFn generator, defined at the top of each file but used in only 1–2 tests) directly into the it block(s) that use it, matching the dominant pattern in these files where each test defines its own queryFn inline. The 4th (noPrev) parameter is dropped since no call site ever passed it.

✅ 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
    • Updated infinite-query test scenarios across supported frameworks to define paginated test data directly within each case.
    • Preserved coverage for pagination, refetching, removed pages, next-page detection, and Suspense behavior.

…'fetchItems' helper into the tests that use it
@nx-cloud

nx-cloud Bot commented Jul 19, 2026

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit 2856b6c

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

☁️ Nx Cloud last updated this comment at 2026-07-19 04:50: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 19, 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: 823e2f7f-9559-437c-b63a-2fb92ebe92c9

📥 Commits

Reviewing files that changed from the base of the PR and between d1558c1 and 2856b6c.

📒 Files selected for processing (3)
  • packages/preact-query/src/__tests__/useInfiniteQuery.test.tsx
  • packages/react-query/src/__tests__/useInfiniteQuery.test.tsx
  • packages/solid-query/src/__tests__/useInfiniteQuery.test.tsx

📝 Walkthrough

Walkthrough

The Preact, React, and Solid infinite-query tests remove shared fetchItems helpers. Affected tests now inline asynchronous page generation, including items, cursors, timestamps, and noNext handling.

Changes

Infinite-query test updates

Layer / File(s) Summary
Inline paginated query functions
packages/*-query/src/__tests__/useInfiniteQuery.test.tsx
Pagination and Suspense tests construct equivalent Result objects directly inside queryFn implementations after removing the shared helper.

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

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: inlining the shared fetchItems helper in useInfiniteQuery tests.
Description check ✅ Passed The description matches the template and includes the changes, checklist, and release impact sections with relevant details.
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-fetchitems-useinfinitequery

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

@pkg-pr-new

pkg-pr-new Bot commented Jul 19, 2026

Copy link
Copy Markdown
More templates

@tanstack/angular-query-experimental

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

@tanstack/eslint-plugin-query

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

@tanstack/lit-query

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

@tanstack/preact-query

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

@tanstack/preact-query-devtools

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

@tanstack/preact-query-persist-client

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

@tanstack/query-async-storage-persister

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

@tanstack/query-broadcast-client-experimental

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

@tanstack/query-core

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

@tanstack/query-devtools

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

@tanstack/query-persist-client-core

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

@tanstack/query-sync-storage-persister

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

@tanstack/react-query

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

@tanstack/react-query-devtools

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

@tanstack/react-query-next-experimental

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

@tanstack/react-query-persist-client

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

@tanstack/solid-query

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

@tanstack/solid-query-devtools

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

@tanstack/solid-query-persist-client

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

@tanstack/svelte-query

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

@tanstack/svelte-query-devtools

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

@tanstack/svelte-query-persist-client

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

@tanstack/vue-query

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

@tanstack/vue-query-devtools

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

commit: 2856b6c

@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 19, 2026
@sukvvon
sukvvon merged commit 44f38df into main Jul 19, 2026
9 checks passed
@sukvvon
sukvvon deleted the test/inline-fetchitems-useinfinitequery branch July 19, 2026 07:55
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