mikebridge opened a new issue, #43656:
URL: https://github.com/apache/superset/issues/43656

   ### Bug description
   
   Since ~2026-08-27, PR runs of the **Frontend Build CI** workflow 
intermittently fail `sharded-jest-tests (3)` in 
`superset-frontend/src/SqlLab/components/SqlEditor/SqlEditor.test.tsx`. The 
failing assertion varies between runs (`disables the save dataset button when 
the results are not loaded`, `enables the save dataset button when the latest 
query succeeded`), but the error is always the same shape:
   
   ```
   SyntaxError: 'button,,,,,,b0zx5mQ-more.ant-tabs-nav-more 
.ant-tabs-tab-btn:focus-visible' is not a valid selector
       at emit (node_modules/nwsapi/src/nwsapi.js:670:17)
       at parse (node_modules/nwsapi/src/nwsapi.js:1612:13)
       at _querySelectorAll (node_modules/nwsapi/src/nwsapi.js:1701:44)
       at Object._querySelector [as first] 
(node_modules/nwsapi/src/nwsapi.js:1637:14)
       at Array.Resolver (eval at compile 
(node_modules/nwsapi/src/nwsapi.js:896:17), <anonymous>:3:67)
       at match_assert (node_modules/nwsapi/src/nwsapi.js:1556:13)
       at Object._matches [as match] (node_modules/nwsapi/src/nwsapi.js:1626:16)
       at getComputedStyleImplementation 
(node_modules/dom-accessibility-api/sources/accessible-name-and-description.ts:84:16)
       at isHidden 
(node_modules/dom-accessibility-api/sources/accessible-name-and-description.ts:570:4)
       at computeTextAlternative 
(node_modules/dom-accessibility-api/sources/accessible-name-and-description.ts:721:3)
       at computeAccessibleName 
(node_modules/dom-accessibility-api/sources/accessible-name.ts:40:31)
       at queryAllByRole 
(node_modules/@testing-library/dom/dist/queries/role.js:168:6)
       at checkCallback 
(node_modules/@testing-library/dom/dist/wait-for.js:124:77)
   ```
   
   **Root cause.** `findByRole(...)` makes React Testing Library compute an 
accessible name for every candidate element; for the antd Tabs overflow "more" 
button that calls jsdom's `getComputedStyle`, which matches the element against 
antd's Tabs stylesheet rule 
`.ant-tabs-tab-focus:has(.ant-tabs-tab-btn:focus-visible)` through **nwsapi 
2.2.23**. That version's `:has()` resolver rewrites `:scope` into a reference 
selector for the element and emits a malformed selector list 
(`button,,,,,,<id>-more…`). This is upstream dperini/nwsapi#157 ("nwsapi 
generates malformed CSS selectors with multiple consecutive commas … after 
nwsapi got bumped to 2.2.23"), same stack, fixed upstream and closed 2026-07-10.
   
   Our dependency path is `[email protected][email protected][email protected]`, held there by the lockfile within the existing `overrides` 
entry `"nwsapi": "^2.2.13"`. 2.2.23 has been in the lockfile since #40206 
(May); the assertions that walk accessible names over the Tabs "more" button 
arrived with #43330 (08-21), which is why it surfaced now.
   
   **Reproduction.** Run the whole file (a single `-t` test does not reproduce 
it):
   
   ```
   cd superset-frontend && npx jest 
src/SqlLab/components/SqlEditor/SqlEditor.test.tsx
   ```
   
   Locally with nwsapi 2.2.23 roughly 1 run in 3 fails; with 
`node_modules/nwsapi/src/nwsapi.js` replaced by 2.2.24 or 2.2.25, 6/6 runs pass 
for each.
   
   **Affected runs (unrelated PRs, same shard, same error):** #42760 (runs 
33133494185, 33198067432), #43633 / #43619 (noted in #43633's description), 
`sc-107907` (33197933380), `dashboard-pw-tabs` (33196529525). Master push runs 
are green because master doesn't hit the timing window as often; PRs are paying 
a re-run each.
   
   **Fix.** Raise the `overrides` floor to `"nwsapi": "^2.2.24"` and update the 
lock entry (2 files, 4 lines). PR to follow.
   
   ### Screenshots/recordings
   
   _No response_
   
   ### Superset version
   
   master / latest-dev
   
   ### Python version
   
   3.11
   
   ### Node version
   
   24
   
   ### Browser
   
   Not applicable
   
   ### Additional context
   
   Upstream: dperini/nwsapi#157 (and the related #152, #153). The 
`:has(…:focus-visible)` Tabs rule has been present since at least antd 6.6.0, 
so the antd 6.6.1 bump (#43509) is not the trigger.
   
   ### Checklist
   
   - [x] I have searched Superset docs and Slack and didn't find a solution to 
my problem.
   - [x] I have searched the GitHub issue tracker and didn't find a similar bug 
report.
   - [x] I have checked Superset's logs for errors and if I found a relevant 
Python stacktrace, I included it here as text in the "additional context" 
section.
   


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