sadpandajoe opened a new pull request, #44843:
URL: https://github.com/apache/superset/pull/44843
### SUMMARY
Adds React Testing Library coverage for three CRUD-style Explore controls.
This change touches test files only.
- **Column config** (`ColumnConfigControl.test.tsx` and
`ControlForm.test.tsx`, both new)
- Rows: one row per column, filtering by `appliedColumnNames`, and the
12-column "show all" threshold with its toggle.
- Popover edits are debounced, then merged into the stored config.
- Configs for columns that are no longer known or are hidden get pruned.
- Time comparison columns get a General tab.
- Child columns configured as not visible show the hidden-column icon.
- The `__timestamp` alias label.
- `ControlForm`: field seeding, merged and debounced edits, validation
errors, and empty values.
- **Conditional formatting** (`ConditionalFormattingControl.test.tsx`)
- Add, edit and delete flows through the popover. Each checks that the
`onChange` list keeps the other formatters in place.
- Formatters whose column leaves the column options get pruned, with an
opt-out.
- **Contours** (`ContourControl/*.test.tsx`, new)
- `ContourPopoverControl`: picks the isoline or isoband tab, saves the
right shape, switches between tabs, and validates integers and threshold order.
- `ContourPopoverTrigger`: controlled and uncontrolled visibility.
- `ContourOption`: labels, remove, and edit.
- The `ContourControl` list: defaults, z-index ordering, add, edit and
remove.
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, so a later
fix won't have to rewrite these tests:
- `ColumnConfigControl` saves edits to the time column under its display
alias ("Time"). The table plugins look the config up under `__timestamp`.
- The contour popover saves a missing upper threshold or stroke width as
`NaN`.
- An isoband with an upper threshold of `0` is treated as an isoline,
because of a truthiness check.
### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
N/A: tests only.
### TESTING INSTRUCTIONS
```bash
cd superset-frontend
npx jest \
src/explore/components/controls/ColumnConfigControl \
src/explore/components/controls/ConditionalFormattingControl \
src/explore/components/controls/ContourControl
```
### ADDITIONAL INFORMATION
- [ ] Has associated issue:
- [ ] Required feature flags:
- [ ] Changes UI
- [ ] Includes DB Migration (follow approval process in
[SIP-59](https://github.com/apache/superset/issues/13351))
- [ ] 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](https://claude.com/claude-code)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]