Repository navigation
test(explore): cover cartodiagram and primitive explore controls - #44850
sadpandajoe wants to merge 5 commits into
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 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #44850 +/- ##
==========================================
+ Coverage 81.65% 81.89% +0.23%
==========================================
Files 2977 2977
Lines 181253 181253
Branches 41873 41873
==========================================
+ Hits 148003 148434 +431
+ Misses 30522 30091 -431
Partials 2728 2728
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 evan@preset.io.
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 <noreply@anthropic.com>
✅ 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 <noreply@anthropic.com>
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 |
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,XAxisSortControl,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:
XAxisSortControlcopiesvalueinto local state once, so a value change from the parent is ignored.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/XAxisSortControl.test.tsx \ src/explore/components/controls/TimeRangeControl \ src/explore/components/controls/CustomListItem \ src/explore/components/controls/ViewQueryModalFooter.test.tsxADDITIONAL INFORMATION
🤖 Generated with Claude Code