sadpandajoe opened a new pull request, #44838:
URL: https://github.com/apache/superset/pull/44838

   ### SUMMARY
   
   Ports the rest of the Explore coverage from the deleted Cypress `_skip` 
specs (removed in #40384) to Jest + React Testing Library. These flows don't 
need a backend, so they're tested at the component level. This change touches 
test files only.
   
   - **Adhoc filters** (`AdhocFilterControl.test.tsx`, 
`AdhocFilterEditPopover.test.tsx`)
     - New tests save a simple filter and a custom SQL filter from the 
control's popover. They check the `onChange` payload and the pill label that 
renders.
     - The skipped test "updates the filter when changes are made" is 
re-enabled. It used a `sql-input` test id that no longer exists, and it 
depended on the lazily loaded Ace editor. It now mocks `EditorHost` with a 
textarea, the same way `AdhocFilterEditPopoverSqlTabContent.test.tsx` does. Its 
assertions are unchanged.
   - **Adhoc metrics** (`DndMetricSelect.test.tsx`)
     - A new test builds a simple metric (custom title, column + SUM) starting 
from an empty drop zone.
     - A new test clicks a metric's remove control and checks that only that 
metric is dropped from `onChange`.
   - **Custom time comparison** (`SelectControl.test.tsx`)
     - The test renders the real `time_compare` config from the Advanced 
Analytics section, so it breaks if the control stops being `multi` / `freeForm`.
     - It enters "28 days" and "1 year" as free-form values and checks 
`onChange`, then checks that both show as tags.
   - **Annotations** (`AnnotationLayerControl/index.test.tsx`)
     - A new test adds a Formula annotation layer through the control. It 
checks the `onChange` payload and that the layer name is listed.
     - The old spec also checked that a mocked chart query fires. That can't be 
reached from the control alone, so it's left out.
   
   Each new test was checked by breaking the related product code, for example 
dropping the `onChange` call, removing `freeForm`, or changing the splice 
index. The test failed each time, and the product code was then restored.
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   
   N/A: tests only.
   
   ### TESTING INSTRUCTIONS
   
   ```bash
   cd superset-frontend
   npx jest \
     src/explore/components/controls/AnnotationLayerControl/index.test.tsx \
     
src/explore/components/controls/DndColumnSelectControl/DndMetricSelect.test.tsx 
\
     src/explore/components/controls/FilterControl/AdhocFilterControl \
     
src/explore/components/controls/FilterControl/AdhocFilterEditPopover/AdhocFilterEditPopover.test.tsx
 \
     src/explore/components/controls/SelectControl.test.tsx
   ```
   
   ### 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]

Reply via email to