test(lit-query/createInfiniteQueryController): add tests for cancelling the query function when disconnected and for replacing 'skipToken' - #11761
Conversation
|
View your CI Pipeline Execution ↗ for commit 30c7f76
☁️ Nx Cloud last updated this comment at |
🚀 Changeset Version PreviewNo changeset entries found. Merging this PR will not cause a version bump for any packages. |
size-limit report 📦
|
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: TanStack/query/.coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (1)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthroughThe change adds two tests for the Lit infinite query controller. One checks abort-listener invocation after host removal. The other checks query execution and rendered page data after ChangesInfinite query controller test coverage
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~10 minutes Change: Other Merge Risk: ⚪ Minimal · up to This change adds test coverage for query cancellation on host removal and for activation after a skipToken is replaced. It does not change runtime behavior, and no merge-blocking risk remains. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…ng the query function when disconnected and for replacing 'skipToken'
14de993 to
30c7f76
Compare
🎯 Changes
Adds two tests to
createInfiniteQueryController.test.ts:should cancel the query function when there are no more subscriptions: while the first page is still loading, removing the host aborts the query function'ssignal.should not fetch when queryFn is skipToken, and fetch once it is replaced: with a function for options,queryFnisskipTokenuntil the reactivepostIdproperty is set. The query doesn't fetch before that, then fetches the first page once.Both render the result in the host and assert it with
toHaveTextContent.✅ Checklist
pnpm run test:pr, or these tests do not apply to this pull request.🚀 Release Impact
Summary by CodeRabbit