-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
test(svelte-query): add infinite query setQueryData test #9714
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Caution Review failedThe pull request is closed. WalkthroughAdds a new Svelte test component that creates an infinite query and exposes a button which updates the query's pages via QueryClient.setQueryData; extends the test suite to render the component, simulate the update, and assert the page data changes. (≈33 words) Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor Tester as Test Runner
participant Svelte as ChangeClient.svelte
participant Query as createInfiniteQuery
participant Client as QueryClient
participant Server as queryFn
Tester->>Svelte: render(ChangeClient, { queryClient })
Svelte->>Query: init with { queryKey, queryFn, getNextPageParam, initialPageParam }
Query->>Server: fetch(firstPage)
Server-->>Query: resolve(firstPage)
Query-->>Svelte: data = { pages: [firstPage], pageParams: [firstPage] }
Svelte-->>Tester: render JSON of data
Tester->>Svelte: click "setPages"
Svelte->>Client: setQueryData(queryKey, { pages: [7,8], pageParams: [7,8] })
Client-->>Query: notify subscribers
Query-->>Svelte: updated data
Svelte-->>Tester: render updated JSON
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Suggested reviewers
Poem
✨ Finishing touches
🧪 Generate unit tests
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (2)
Comment |
View your CI Pipeline Execution ↗ for commit 4597c75
☁️ Nx Cloud last updated this comment at |
Sizes for commit 4597c75:
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #9714 +/- ##
===========================================
+ Coverage 46.41% 89.20% +42.78%
===========================================
Files 214 18 -196
Lines 8499 176 -8323
Branches 1922 31 -1891
===========================================
- Hits 3945 157 -3788
+ Misses 4111 18 -4093
+ Partials 443 1 -442
🚀 New features to boost your workflow:
|
🎯 Changes
Migrates equivalent test from react-query:
query/packages/react-query/src/__tests__/useInfiniteQuery.test.tsx
Lines 1171 to 1226 in 571bc18
✅ Checklist
pnpm test:pr
.🚀 Release Impact
Summary by CodeRabbit