Skip to content

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

Open
sadpandajoe wants to merge 5 commits into
masterfrom
explore-rtl-control-primitives
Open

sadpandajoe wants to merge 5 commits into
masterfrom
explore-rtl-control-primitives

Conversation

@sadpandajoe

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, XAxisSortControl, 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:

  • XAxisSortControl copies value into local state once, so a value change from the parent is ignored.
  • 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/XAxisSortControl.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 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@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 81.89%. Comparing base (883e43e) to head (7f1c2af).
⚠️ Report is 171 commits behind head on master.

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              
Flag Coverage Δ
javascript 77.56% <ø> (+0.49%) ⬆️

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 evan@preset.io.

Documentation & Help

AI Code Review powered by Bito Logo

Comment thread superset-frontend/src/explore/components/controls/XAxisSortControl.test.tsx Outdated
Comment thread superset-frontend/src/explore/components/controls/XAxisSortControl.test.tsx Outdated
Comment thread superset-frontend/src/explore/components/controls/ViewQueryModalFooter.test.tsx Outdated
@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 evan@preset.io.

Documentation & Help

AI Code Review powered by Bito Logo

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

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@netlify

netlify Bot commented Oct 2, 2026

Copy link
Copy Markdown

✅ Deploy Preview for superset-docs-preview ready!

Name Link
🔨 Latest commit 42e70e5
🔍 Latest deploy log https://app.netlify.com/projects/superset-docs-preview/deploys/6abfda6427664e00084e75ee
😎 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 evan@preset.io.

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 <noreply@anthropic.com>
@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 evan@preset.io.

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

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

requires:rebase Requires rebasing on top of current master size/XXL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant