test(query-devtools/Devtools): add tests for settings menu#10690
test(query-devtools/Devtools): add tests for settings menu#10690
Conversation
|
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)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughTest updates: removed a PointerEvent polyfill from test setup and added keyboard-driven settings menu tests that traverse Position, Theme, and Hide-disabled-queries sub-menus and verify persistence to localStorage. ChangesSettings Menu 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)
Comment |
|
View your CI Pipeline Execution ↗ for commit 51ebac5
☁️ 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. |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/query-devtools/src/__tests__/Devtools.test.tsx`:
- Around line 826-828: Replace conditional guards that silently skip
interactions with explicit presence assertions, then perform the event; for each
occurrence (subTrigger, themeTrigger, hideTrigger, topItem, lightItem, hideItem)
remove the surrounding if (el) { ... } and instead assert the element exists
(e.g., expect(<symbol>).toBeInTheDocument() or expect(<symbol>).not.toBeNull())
immediately before calling fireEvent.keyDown or other interactions so the test
fails fast when a selector is missing and the interaction always runs when the
element is present.
🪄 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: cb404dae-f4b8-4a89-942d-23c44fc19ada
📒 Files selected for processing (1)
packages/query-devtools/src/__tests__/Devtools.test.tsx
…ditional guards on selector lookups
…'TS18047' under strict 'vue-tsc' build
9c20961 to
e6432af
Compare
size-limit report 📦
|
…ttings button' covered by other settings menu tests
🎯 Changes
Adds tests for the settings menu in
Devtools.tsx, covering 7 cases:should show "Position" sub-trigger when the settings menu is openedshould open "Position" sub-menu when the sub-trigger is activatedshould persist "position" when a position radio item is selectedshould open "Theme" sub-menu when the sub-trigger is activatedshould persist "theme_preference" when a theme radio item is selectedshould open "Hide disabled queries" sub-menu when the sub-trigger is activatedshould persist "hideDisabledQueries" when a hide-disabled radio item is selectedKobalte's
DropdownMenuis exercised through its keyboard activation path (Enteron the trigger and radio items,ArrowRighton sub-triggers), avoiding the need for aPointerEventpolyfill in jsdom.✅ Checklist
pnpm run test:pr.🚀 Release Impact
Summary by CodeRabbit