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

   ### SUMMARY
   
   Add 22 Jest contract tests for the SQL Lab SDK API surface 
(`src/core/sqlLab/index.ts`) that extensions depend on. This is a companion to 
#38776 (host-wiring tests) and covers the Redux listener middleware + 
module-level singleton surface.
   
   **Test breakdown:**
   - 11 event listener tests (onDidQueryRun, onDidQuerySuccess, onDidQueryStop, 
onDidQueryFail, onDidChangeEditorDatabase, onDidChangeEditorSchema, 
onDidChangeActivePanel, onDidChangeTabTitle, onDidCloseTab, 
onDidChangeActiveTab, onDidCreateTab)
   - 3 predicate scoping tests (editor-scoped filtering via query immutableId, 
editor-scoped filtering via queryEditor lookup, globalPredicate fires for 
non-active tabs)
   - 1 disposable pattern test (dispose stops listener from receiving events)
   - 7 imperative function tests (getCurrentTab, getActivePanel, getTabs, 
getDatabases, createTab, setActiveTab, setActivePanel)
   
   **Architecture:** Real `configureStore` + real `createListenerMiddleware` 
with `sqlLabReducer` — no over-mocking. Store reset + `clearListeners()` in 
`afterEach` ensures no test-to-test state leaks (verified with `--randomize`).
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   
   N/A — test-only change.
   
   ### TESTING INSTRUCTIONS
   
   ```bash
   cd superset-frontend
   npx jest src/core/sqlLab/sqlLab.test.ts --maxWorkers=2
   npx jest src/core/sqlLab/sqlLab.test.ts --maxWorkers=2 --randomize
   ```
   
   ### 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


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