Skip to content

test(frontend): await the userEvent calls that needed restructuring - #44799

Merged
sadpandajoe merged 1 commit into
apache:masterfrom
SEPURI-SAI-KRISHNA:fix/flaky-await-userevent-restructured
Oct 2, 2026
Merged

sadpandajoe merged 1 commit into
apache:masterfrom
SEPURI-SAI-KRISHNA:fix/flaky-await-userevent-restructured

Conversation

@SEPURI-SAI-KRISHNA

Copy link
Copy Markdown
Contributor

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

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

@bito-code-review

bito-code-review Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Code Review Agent Run #6d3d60

Actionable Suggestions - 0
Review Details
  • Files reviewed - 4 · Commit Range: 285f735..285f735
    • superset-frontend/src/SqlLab/components/SqlEditorTabHeader/SqlEditorTabHeader.test.tsx
    • superset-frontend/src/components/RowCountLabel/RowCountLabel.test.tsx
    • superset-frontend/src/features/datasets/AddDataset/Footer/Footer.test.tsx
    • superset-frontend/src/pages/Home/Home.test.tsx
  • Files skipped - 0
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers an incremental AI Review.

  • /review full - Manually triggers a full AI Review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at evan@preset.io.

Documentation & Help

AI Code Review powered by Bito Logo

@codecov

codecov Bot commented Sep 29, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.52%. Comparing base (ce86ac9) to head (285f735).

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #44799   +/-   ##
=======================================
  Coverage   81.52%   81.52%           
=======================================
  Files        2974     2974           
  Lines      180288   180288           
  Branches    41741    41741           
=======================================
+ Hits       146980   146982    +2     
+ Misses      30585    30583    -2     
  Partials     2723     2723           
Flag Coverage Δ
javascript 77.03% <ø> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@rusackas rusackas left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mechanical and correct, each site matches the specific bug pattern described (fire-and-forget click inside a waitFor retry, synchronous hover-then-assert, unawaited shared helper). Nice finish to the #44798 series. Approving.

@sadpandajoe
sadpandajoe merged commit 2872d16 into apache:master Oct 2, 2026
84 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Seven un-awaited userEvent call sites remain after the user-event v14 migration

3 participants

Sponsor
SponsoredKunjungi sekarang
Promo