SEPURI-SAI-KRISHNA opened a new pull request, #44799:
URL: https://github.com/apache/superset/pull/44799

   ### SUMMARY
   
   #43512 made every `@testing-library/user-event` API asynchronous. #44315, 
#44323 and #44335 awaited the calls that needed only a mechanical `await`, and 
deliberately left seven call sites out because awaiting them in place would not 
have been correct. This PR finishes those seven (details in #44798). Each needs 
a different fix:
   
   **`RowCountLabel.test.tsx` (4 sites)**, four synchronous tests hovered and 
then asserted immediately, so the assertion ran before the hover was dispatched 
and could not observe it; the tests would pass with the hover deleted. They 
become `async` and await the hover. The expectation itself is unchanged and 
still correct: `RowCountLabel` renders a `Tooltip` only when `limitReached`, 
which is false in all four.
   
   **`Home.test.tsx`, `Footer.test.tsx` (1 site each)**, both had an un-awaited 
click inside a `waitFor` callback, which `waitFor` retries, making the click 
fire-and-forget and possibly repeated. The click is lifted out and awaited, 
leaving only the assertion inside `waitFor`. In `Footer.test.tsx` the 
surrounding `waitFor` is replaced by `findByText`, which is what it was 
emulating.
   
   **`SqlEditorTabHeader.test.tsx` (1 site, 12 callers)**, the 
`openTabDropdown` helper was synchronous, so all 12 tests asserted against a 
dropdown whose opening click had not been dispatched. The helper becomes 
`async` and every call site awaits it. All 12 enclosing tests were already 
`async`, so no test signature changes.
   
   No assertions were weakened, no timeouts widened, no retries added, and no 
production code is touched.
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   
   N/A: test-only change.
   
   ### TESTING INSTRUCTIONS
   
   ```bash
   cd superset-frontend
   npm run test -- \
     src/components/RowCountLabel/RowCountLabel.test.tsx \
     src/pages/Home/Home.test.tsx \
     src/features/datasets/AddDataset/Footer/Footer.test.tsx \
     src/SqlLab/components/SqlEditorTabHeader/SqlEditorTabHeader.test.tsx
   ```
   
   All 43 tests across the 4 suites pass. `oxlint` and `oxfmt --check` are 
clean on the changed files, and `tsc --noEmit` over the whole 
`superset-frontend` project reports no errors.
   
   ### ADDITIONAL INFORMATION
   
   - [x] Has associated issue: Fixes #44798
   - [ ] 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