Skip to content

fix(tests): await userEvent.click in CsrfErrorMessage compact-mode test - #44540

Merged
rusackas merged 1 commit into
masterfrom
fix/csrf-test-await-userevent
Sep 22, 2026
Merged

rusackas merged 1 commit into
masterfrom
fix/csrf-test-await-userevent

Conversation

@rusackas

Copy link
Copy Markdown
Member

SUMMARY

Found while chasing an intermittent sharded-jest-tests failure on an unrelated PR: CsrfErrorMessage.test.tsx's compact-mode test calls userEvent.click(...) without await, letting the assertion right after it race the click's own React state update. Every other userEvent.click call in src/components/ErrorMessage/ (Database/ErrorMessageWithStackTrace/FrontendNetworkError/ParameterError/TimeoutError) awaits it; this was the only one that didn't.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

N/A, test-only change.

TESTING INSTRUCTIONS

cd superset-frontend
npx jest src/components/ErrorMessage/CsrfErrorMessage.test.tsx

All 3 tests pass.

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • 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

🤖 Generated with Claude Code

Every other userEvent.click in superset-frontend/src/components/ErrorMessage
is awaited; this one wasn't, letting the assertion after the click race the
click's own state update. Intermittently failed in CI depending on timing
(observed failing consistently in one run, passing in others at the same
jest shard), unrelated to whatever else happened to be in the PR that
triggered it.

Co-Authored-By: Evan Rusackas <evan@preset.io>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@bito-code-review

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

Copy link
Copy Markdown
Contributor

Code Review Agent Run #4dad28

Actionable Suggestions - 0
Review Details
  • Files reviewed - 1 · Commit Range: 7fa2de9..7fa2de9
    • superset-frontend/src/components/ErrorMessage/CsrfErrorMessage.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 22, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 66.21%. Comparing base (ee4b8dd) to head (7fa2de9).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #44540      +/-   ##
==========================================
+ Coverage   66.15%   66.21%   +0.05%     
==========================================
  Files        2946     2948       +2     
  Lines      176943   177169     +226     
  Branches    40965    41061      +96     
==========================================
+ Hits       117063   117304     +241     
+ Misses      57384    57369      -15     
  Partials     2496     2496              
Flag Coverage Δ
javascript 76.31% <ø> (+0.07%) ⬆️

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 merged commit 9f48d0e into master Sep 22, 2026
87 of 88 checks passed
@rusackas
rusackas deleted the fix/csrf-test-await-userevent branch September 22, 2026 19:00
villebro pushed a commit that referenced this pull request Sep 22, 2026
…st (#44540)

Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
(cherry picked from commit 9f48d0e)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants