Conversation
…text provider, 'client' prop, and production fallback
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughAdds Vitest test scripts and two test suites for the preact-query-devtools package that mock ChangesPreact Query Devtools Test Coverage
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Review rate limit: 4/5 reviews remaining, refill in 12 minutes. Comment |
|
View your CI Pipeline Execution ↗ for commit 1c5596d
☁️ 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 📦
|
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 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/preact-query-devtools/src/__tests__/PreactQueryDevtools.test.tsx`:
- Around line 37-57: Tests for PreactQueryDevtools currently only assert render
doesn't throw, which misses silent no-op mounts; update both test cases that
render <PreactQueryDevtools /> (the "provided via context" and "provided via
props" cases) to also assert that the module mount helper (mountMock) was
invoked after render. Locate the tests importing PreactQueryDevtools and
QueryClient and, after calling render(...) in both specs, add an expectation
that mountMock was called (e.g., expect(mountMock).toHaveBeenCalled()) to ensure
the component actually mounted when given a client via QueryClientProvider and
when passed via the client prop.
In
`@packages/preact-query-devtools/src/__tests__/PreactQueryDevtoolsPanel.test.tsx`:
- Around line 36-58: The tests currently only assert that rendering
PreactQueryDevtoolsPanel does not throw; update both tests (the ones importing
PreactQueryDevtoolsPanel and creating a QueryClient) to also assert that the
mocked mount function was invoked: after rendering inside the
QueryClientProvider test and after rendering with the client prop, add
expectations that mountMock was called (e.g.,
expect(mountMock).toHaveBeenCalled() or toHaveBeenCalledTimes(1)); reference the
PreactQueryDevtoolsPanel import and the mountMock mock to locate where to add
these assertions.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: bd4bcaf4-7ca0-4e63-a35c-79e321ef776f
📒 Files selected for processing (3)
packages/preact-query-devtools/package.jsonpackages/preact-query-devtools/src/__tests__/PreactQueryDevtools.test.tsxpackages/preact-query-devtools/src/__tests__/PreactQueryDevtoolsPanel.test.tsx
🎯 Changes
Add tests for
preact-query-devtoolscovering wrapper invariants and the production fallback inindex.ts.test:lib/test:lib:devscripts (package's vitest environment was already in place from prior work).PreactQueryDevtools.test.tsxwith 4 cases:QueryClientis set.QueryClientis provided via<QueryClientProvider>.QueryClientis provided via theclientprop.nullin non-development environments (production fallback inindex.ts).PreactQueryDevtoolsPanel.test.tsxwith the same 4 cases forPreactQueryDevtoolsPanel.The tests mock
@tanstack/query-devtoolsto keep the wrapper isolated from the Solid-based core, since@preact/preset-vitecannot transform the core's.tsxfiles.✅ Checklist
🚀 Release Impact
Summary by CodeRabbit
Tests
Chores
test:libandtest:lib:dev(watch mode) to simplify running the library test suite.