test(frontend): await the userEvent calls that needed restructuring - #44799
sadpandajoe merged 1 commit into
Conversation
Code Review Agent Run #6d3d60Actionable Suggestions - 0Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
Codecov Report✅ All modified and coverable lines are covered by tests. 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
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
SUMMARY
#43512 made every
@testing-library/user-eventAPI asynchronous. #44315, #44323 and #44335 awaited the calls that needed only a mechanicalawait, 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 becomeasyncand await the hover. The expectation itself is unchanged and still correct:RowCountLabelrenders aTooltiponly whenlimitReached, which is false in all four.Home.test.tsx,Footer.test.tsx(1 site each), both had an un-awaited click inside awaitForcallback, whichwaitForretries, making the click fire-and-forget and possibly repeated. The click is lifted out and awaited, leaving only the assertion insidewaitFor. InFooter.test.tsxthe surroundingwaitForis replaced byfindByText, which is what it was emulating.SqlEditorTabHeader.test.tsx(1 site, 12 callers), theopenTabDropdownhelper was synchronous, so all 12 tests asserted against a dropdown whose opening click had not been dispatched. The helper becomesasyncand every call site awaits it. All 12 enclosing tests were alreadyasync, 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
All 43 tests across the 4 suites pass.
oxlintandoxfmt --checkare clean on the changed files, andtsc --noEmitover the wholesuperset-frontendproject reports no errors.ADDITIONAL INFORMATION