test(solid-query/useQuery): add test for refetching query when 'queryClient' changes#10167
test(solid-query/useQuery): add test for refetching query when 'queryClient' changes#10167sukvvon wants to merge 6 commits intoTanStack:mainfrom
Conversation
|
|
No actionable comments were generated in the recent review. 🎉 📝 WalkthroughWalkthroughAdds a test to Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Comment |
|
View your CI Pipeline Execution ↗ for commit ac5447c
☁️ Nx Cloud last updated this comment at |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@packages/solid-query/src/__tests__/useQuery.test.tsx`:
- Around line 6194-6212: The test currently drives both the QueryClientProvider
and the useQuery client accessor from the same signal so it doesn't truly verify
the explicit client accessor; change the setup so QueryClientProvider receives a
fixed client (e.g., queryClient1) while the accessor passed into Page (the prop
used by useQuery) is driven by createSignal and toggled to a different client
(e.g., queryClient2); update the render to pass a constant client to
QueryClientProvider and pass client() (signal) into <Page client={client()} />,
so Page -> useQuery(...) uses the decoupled accessor and the test asserts the
explicit client parameter behavior (reference symbols: QueryClientProvider,
Page, useQuery, createSignal, client, setClient, queryClient1, queryClient2).
…wrapper from explicit client test
…=> QueryClient' type annotation
🎯 Changes
Add a test to verify that when
queryClientchanges, the query refetches with the new client. CoversuseBaseQuery.tslines 317-327 where the client signal change triggers observer re-creation and re-subscription.✅ Checklist
pnpm run test:pr.🚀 Release Impact
Summary by CodeRabbit