Repository navigation
test(explore): cover cartodiagram and primitive explore controls - #44850
Conversation
Add React Testing Library coverage for the zoom config, map view, and layer config controls, and for the switch, slider, vertical radio, x-axis sort, time range, custom list item, and view query footer controls. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #44850 +/- ##
==========================================
- Coverage 83.26% 82.65% -0.61%
==========================================
Files 3038 3001 -37
Lines 198104 184537 -13567
Branches 46192 43297 -2895
==========================================
- Hits 164956 152538 -12418
+ Misses 29923 29271 -652
+ Partials 3225 2728 -497
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Code Review Agent Run #3bde65
Actionable Suggestions - 6
-
superset-frontend/src/explore/components/controls/LayerConfigsControl/LayerConfigsControl.test.tsx - 2
- Non-discriminating fixture assertion · Line 28-28
- Missing coverage: reorder, WFS/XYZ, undefined · Line 46-139
-
superset-frontend/src/explore/components/controls/XAxisSortControl.test.tsx - 3
- Untyped test helper overrides · Line 27-27
- Missing state assertion in test · Line 47-50
- Assertion order in reset test · Line 53-54
-
superset-frontend/src/explore/components/controls/ViewQueryModalFooter.test.tsx - 1
- History v5 state shape mismatch · Line 72-72
Additional Suggestions - 4
-
superset-frontend/src/explore/components/controls/ViewQueryModalFooter.test.tsx - 2
-
Ctrl-click path untested · Line 78-78The component treats `metaKey` and `ctrlKey` as equivalent new-tab signals (`ViewQuery.tsx:141` does the same), but this test covers only meta-click. On Windows/Linux, ctrl-click is the dominant new-tab gesture, so that path ships untested. Consider adding a ctrl-click case. (https://github.com/apache/superset)
-
Untyped test fixture · Line 28-28`datasource` is an untyped object literal while `ViewQueryModalFooterProps.datasource` is typed `SimpleDataSource` in `ViewQueryModalFooter.tsx:26-30`. Typing the fixture would let the compiler catch future contract drift between this test and the component. (https://github.com/apache/superset)
-
-
superset-frontend/src/explore/components/controls/SliderControl.test.tsx - 1
-
Vacuous bound assertion · Line 72-72The assertion is vacuous: `expect.not.arrayContaining([11])` passes even if `onChange` is never called after `mockClear()`, or emits 12 or 100 — only an exact 11 fails. The test name promises no value above `max`, but this cannot verify it. Assert every emitted value is <= max instead (see patch).
-
-
superset-frontend/src/explore/components/controls/CustomListItem/index.test.tsx - 1
-
Selectable path untested · Line 23-29The `renderItems` helper takes `selectable` but its only call (line 32) passes `false`, and the inline render in the ref test also uses `selectable={false}`. `CustomListItem`'s only conditional behavior — the hover cursor/background applied when `selectable` is true in `index.tsx` — is therefore never exercised. Per the repo rule that tests must verify behavior logic, not just rendering, add a `selectable` true case asserting the hover styling.
-
Review Details
-
Files reviewed - 12 · Commit Range:
5f78b97..aab34ec- superset-frontend/src/explore/components/controls/CustomListItem/index.test.tsx
- superset-frontend/src/explore/components/controls/LayerConfigsControl/LayerConfigsControl.test.tsx
- superset-frontend/src/explore/components/controls/MapViewControl/MapViewControl.test.tsx
- superset-frontend/src/explore/components/controls/MapViewControl/MapViewPopoverContent.test.tsx
- superset-frontend/src/explore/components/controls/SliderControl.test.tsx
- superset-frontend/src/explore/components/controls/SwitchControl.test.tsx
- superset-frontend/src/explore/components/controls/TimeRangeControl/index.test.tsx
- superset-frontend/src/explore/components/controls/VerticalRadioControl.test.tsx
- superset-frontend/src/explore/components/controls/ViewQueryModalFooter.test.tsx
- superset-frontend/src/explore/components/controls/XAxisSortControl.test.tsx
- superset-frontend/src/explore/components/controls/ZoomConfigControl/ZoomConfigControl.test.tsx
- superset-frontend/src/explore/components/controls/ZoomConfigControl/ZoomConfigsChart.test.tsx
-
Files skipped - 0
-
Tools
- Whispers (Secret Scanner) - ✔︎ Successful
- Detect-secrets (Secret Scanner) - ✔︎ Successful
Bito Usage Guide
Commands
Type the following command in the pull request comment and save the comment.
-
/review- Manually triggers an incremental AI Review. -
/review full- Manually triggers a full AI Review. -
/pause- Pauses automatic reviews on this pull request. -
/resume- Resumes automatic reviews. -
/resolve- Marks all Bito-posted review comments as resolved. -
/abort- Cancels all in-progress reviews.
Refer to the documentation for additional commands.
Configuration
This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at [email protected].
Documentation & Help
Code Review Agent Run #f9f318Actionable Suggestions - 0Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
…rtions Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
✅ Deploy Preview for superset-docs-preview ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Code Review Agent Run #ee966aActionable Suggestions - 0Additional Suggestions - 1
Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
Type the ViewQueryModalFooter datasource fixture from the component props and narrow the XAxisSortControl setup overrides so spreads are checked. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Code Review Agent Run #eff70cActionable Suggestions - 0Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
…-primitives Reconcile ViewQueryModalFooter, XAxisSortControl and ZoomConfigControl tests with the regression tests that landed on master alongside their fixes.
CodeAnt PR Risk: High Risk
Assessed commit: |
rusackas
left a comment
There was a problem hiding this comment.
Good coverage, and I ran down the bot threads rather than trusting the resolved flag blind. The layersParam/reorder/WFS/XYZ/undefined gaps Bito flagged on LayerConfigsControl.test.tsx are all actually covered once I checked the current file, and the history-state assertion got a real fix (useLocation instead of reading window.history.state).
One thing: the PR description still lists XAxisSortControl as new coverage with a documented "value from parent is ignored" bug left unpinned, but that file isn't in the diff anymore (identical to master now, must have landed from elsewhere during a rebase) and the component no longer has that bug. Worth trimming that bit from the description so it doesn't describe coverage this PR isn't actually shipping. Not a blocker, LGTM otherwise.
SUMMARY
Adds React Testing Library coverage for the cartodiagram controls and a set of small Explore control primitives that had no tests. This change touches test files only.
ZoomConfigControl: switching shape recomputes the per-zoom values (checked against literal expected sizes), and editing the base values.ZoomConfigsChart: drag handles sit at the bar ends. Dragging maps pixel positions back through the chart, and dragging left of the axis clamps to zero.echarts.initis replaced with a fake chart that uses an invertible pixel transform.MapViewControlandMapViewPopoverContent: switching mode, the extent label, and saving a custom extent.LayerConfigsControl: add, edit, remove and close through the real popover, using a WMS layer. Edits keep the layer's type, version and layers parameter.SwitchControl,SliderControl(including keyboard bounds),VerticalRadioControl,TimeRangeControl,CustomListItemandViewQueryModalFooter.Each new test was checked by breaking the related product code, and the test failed each time.
Some behavior that looks like a bug was left unpinned on purpose:
MapViewControlshows a zoom, latitude or longitude of0as unset.cssprop onCustomListItemrenders ascss="[object Object]", so its selectable styles never apply.ZoomConfigControlbase-value handlers mutate the nestedconfigsof thevalueprop.RadioButtonControlcallsonChangetwice.BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
N/A: tests only.
TESTING INSTRUCTIONS
cd superset-frontend npx jest \ src/explore/components/controls/ZoomConfigControl \ src/explore/components/controls/MapViewControl \ src/explore/components/controls/LayerConfigsControl \ src/explore/components/controls/SwitchControl.test.tsx \ src/explore/components/controls/SliderControl.test.tsx \ src/explore/components/controls/VerticalRadioControl.test.tsx \ src/explore/components/controls/TimeRangeControl \ src/explore/components/controls/CustomListItem \ src/explore/components/controls/ViewQueryModalFooter.test.tsxADDITIONAL INFORMATION
🤖 Generated with Claude Code