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

   ### SUMMARY
   
   Adds React Testing Library coverage for the Explore page shell: the chart 
header's action menu, the chart pills, and the view container's wiring. This 
change touches test files only.
   
   - **Header actions** (`ExploreChartHeader.test.tsx`)
     - Copy permalink: the request carries the chart state, the link is copied, 
and a success toast shows. On a failed request or a missing datasource, a 
danger toast shows and nothing is copied.
     - Share by email: opens a `mailto:` link that contains the permalink. On a 
failed request, a danger toast shows instead.
     - Embed code: shows the chart iframe. It is hidden when the 
`EmbeddableCharts` flag is off.
     - View query: sends the rendered chart's form data, shows the generated 
SQL, and closes.
   - **Chart pills** (`ChartPills.test.tsx`, new)
     - Where the row count is read from for table and non-table charts, with 
`sql_rowcount` preferred over `rowcount`.
     - `hideRowCount`.
     - The cached label and its refresh.
     - Loading state.
     - The elapsed timer.
   - **View container** (`ExploreViewContainer.test.tsx`)
     - The Run button state when controls do or do not have validation errors, 
including matrixify control errors.
     - Ctrl/Cmd+Enter queues the chart query.
     - Tooltip template variables get appended. The tests assert the stored 
template value.
     - Datasource metadata is requested only when the datasource control 
changes.
   
   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:
   - Ctrl/Cmd+Enter runs the query even when a control has validation errors 
and the Run button is disabled.
   - `fetchDatasourceMetadata` is called without `dispatch`, so the 
datasource-change effect probably never reaches the store. The test checks that 
the request is made, not what it does to the store.
   - The keydown listener is added on `document`, but a changed handler is 
removed from `window`.
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   
   N/A: tests only.
   
   ### TESTING INSTRUCTIONS
   
   ```bash
   cd superset-frontend
   npx jest \
     src/explore/components/ExploreChartHeader/ExploreChartHeader.test.tsx \
     src/explore/components/ChartPills.test.tsx \
     src/explore/components/ExploreViewContainer/ExploreViewContainer.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