test(solid-query-devtools/devtools): add tests for forwarding 'buttonPosition' and 'position' props to the devtools instance#10819
Conversation
…Position' and 'position' props to the devtools instance
|
View your CI Pipeline Execution ↗ for commit b98f78b
☁️ Nx Cloud last updated this comment at |
🚀 Changeset Version Preview2 package(s) bumped directly, 23 bumped as dependents. 🟩 Patch bumps
|
|
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 (1)
📝 WalkthroughWalkthroughThe test suite for ChangesProp forwarding test coverage
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Possibly related PRs
Suggested labels
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)
Comment |
size-limit report 📦
|
🎯 Changes
Mirrors the React (#10817) and Preact (#10818) adapter PRs for the Solid adapter. Until now
SolidQueryDevtoolsonly had smoke cases (noQueryClient, context, props); the twocreateEffects that threadbuttonPosition/positioninto the core devtools instance (devtools.tsx:79-84and:86-91) were entirely uncovered.Because both `solid-query-devtools` and the underlying `@tanstack/query-devtools` are written in Solid, no module-level mock is needed — `vi.spyOn(TanstackQueryDevtools.prototype, ...)` observes the real instance while it runs:
should forward "buttonPosition" to the devtools instance: spies on `TanstackQueryDevtools.prototype.setButtonPosition`, renders ``, and asserts the spy was called with `'top-left'`, locking in the `if (buttonPos) devtools.setButtonPosition(buttonPos)` branch.should forward "position" to the devtools instance: same shape for the `position` prop / `setPosition` call.An `afterEach(vi.restoreAllMocks)` resets the prototype spies between cases so the existing smoke cases stay isolated.
Coverage for `devtools.tsx` goes 93.33% → 100% statements / 71.42% → 85.71% branches / 92% → 100% lines.
✅ Checklist
🚀 Release Impact
Summary by CodeRabbit