Skip to content

test(explore): cover cartodiagram and primitive explore controls - #44850

Merged
sadpandajoe merged 6 commits into
masterfrom
explore-rtl-control-primitives
Oct 20, 2026
Merged

sadpandajoe merged 6 commits into
masterfrom
explore-rtl-control-primitives

Conversation

@sadpandajoe

@sadpandajoe sadpandajoe commented Oct 1, 2026 •

Copy link
Copy Markdown
Member

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.

  • Cartodiagram controls
    • 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.init is replaced with a fake chart that uses an invertible pixel transform.
    • MapViewControl and MapViewPopoverContent: 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.
  • Primitive controls (all new): SwitchControl, SliderControl (including keyboard bounds), VerticalRadioControl, TimeRangeControl, CustomListItem and ViewQueryModalFooter.

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:

  • MapViewControl shows a zoom, latitude or longitude of 0 as unset.
  • The css prop on CustomListItem renders as css="[object Object]", so its selectable styles never apply.
  • The ZoomConfigControl base-value handlers mutate the nested configs of the value prop.
  • One click on RadioButtonControl calls onChange twice.

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.tsx

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • Migration is atomic, supports rollback & is backwards-compatible
    • Confirm DB migration upgrade and downgrade tested
    • Runtime estimates and downtime expectations provided
  • Introduces new feature or API
  • Removes existing feature or API

🤖 Generated with Claude Code

sadpandajoe and others added 2 commits September 30, 2026 17:11
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]>
@codecov

codecov Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.65%. Comparing base (b840a4c) to head (6c6df64).
⚠️ Report is 3 commits behind head on master.

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     
Flag Coverage Δ
javascript 79.27% <ø> (+0.36%) ⬆️
postgres ?

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@bito-code-review bito-code-review Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
  • superset-frontend/src/explore/components/controls/ViewQueryModalFooter.test.tsx - 1
Additional Suggestions - 4
  • superset-frontend/src/explore/components/controls/ViewQueryModalFooter.test.tsx - 2
    • Ctrl-click path untested · Line 78-78
      The 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-72
      The 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-29
      The `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

AI Code Review powered by Bito Logo

@bito-code-review

bito-code-review Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Code Review Agent Run #f9f318

Actionable Suggestions - 0
Review Details
  • Files reviewed - 2 · Commit Range: aab34ec..e3d21fc
    • superset-frontend/src/explore/components/controls/LayerConfigsControl/LayerConfigsControl.test.tsx
    • superset-frontend/src/explore/components/controls/SliderControl.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

AI Code Review powered by Bito Logo

@sadpandajoe
sadpandajoe requested a review from rusackas October 1, 2026 17:24
@netlify

netlify Bot commented Oct 2, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for superset-docs-preview ready!

Name Link
🔨 Latest commit 6c6df64
🔍 Latest deploy log https://app.netlify.com/projects/superset-docs-preview/deploys/6aceb213da292cd8647f56fa
😎 Deploy Preview https://deploy-preview-44850--superset-docs-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@bito-code-review

bito-code-review Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Code Review Agent Run #ee966a

Actionable Suggestions - 0
Additional Suggestions - 1
  • superset-frontend/src/explore/components/controls/XAxisSortControl.test.tsx - 1
    • Partial<any> defeats typing · Line 28-30
      `Partial>` does not type-check: `XAxisSortControlProps` has an index signature `[key: string]: unknown`, so `ComponentProps` resolves to `any` and `Partial` collapses to `any`, silently disabling override checking. The repo's other typed-setup test (`SaveDatasetModal.test.tsx:50`) uses a component without an index signature. A plain `Record` keeps the spread valid and preserves intent.
Review Details
  • Files reviewed - 3 · Commit Range: e3d21fc..42e70e5
    • superset-frontend/src/explore/components/controls/LayerConfigsControl/LayerConfigsControl.test.tsx
    • superset-frontend/src/explore/components/controls/ViewQueryModalFooter.test.tsx
    • superset-frontend/src/explore/components/controls/XAxisSortControl.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

AI Code Review powered by Bito Logo

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]>
@bito-code-review

bito-code-review Bot commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

Code Review Agent Run #eff70c

Actionable Suggestions - 0
Review Details
  • Files reviewed - 2 · Commit Range: 42e70e5..7f1c2af
    • superset-frontend/src/explore/components/controls/ViewQueryModalFooter.test.tsx
    • superset-frontend/src/explore/components/controls/XAxisSortControl.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

AI Code Review powered by Bito Logo

@github-actions github-actions Bot added the requires:rebase Requires rebasing on top of current master label Oct 7, 2026
…-primitives

Reconcile ViewQueryModalFooter, XAxisSortControl and ZoomConfigControl
tests with the regression tests that landed on master alongside their
fixes.
@codeant-ai-for-open-source

Copy link
Copy Markdown
Contributor

CodeAnt PR Risk: High Risk

  • The PR should not merge yet: its new Ctrl-click test expects a new-tab form post, but the component only handles Meta-click, so the test will fail.

Assessed commit: 6c6df641a830

@sadpandajoe sadpandajoe removed the requires:rebase Requires rebasing on top of current master label Oct 13, 2026

@rusackas rusackas left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@sadpandajoe
sadpandajoe merged commit 6842e2f into master Oct 20, 2026
87 checks passed
@sadpandajoe
sadpandajoe deleted the explore-rtl-control-primitives branch October 20, 2026 21:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants