test(mosaic): wait for alert text instead of the first alert element - #10080
Conversation
Card.Banner always renders an empty role=alert live region, so findByRole('alert') resolves before the error message commits and toHaveTextContent races the render on slower runners.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🦋 Changeset detectedLatest commit: 2f955ee The changes in this PR will be included in the next version bump. This PR includes changesets to release 0 packagesWhen changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. Important Review skippedReview was skipped as selected files did not have any reviewable changes. ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (14)
🔗 Linked repositories identifiedCodeRabbit considers these linked repositories for cross-repo context during reviews:
Included review availability: This review used your included allowance. 2 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 6 reviews per hour. 📝 WalkthroughWalkthroughOrganization-profile and user-profile tests now use Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~10 minutes Suggested reviewers: Merge Risk: ⚪ Minimal · up to These test-only edits wait for the existing alert text, addressing the reported timing flake without changing product behavior. No actionable merge risk is apparent. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Comment |
@clerk/astro
@clerk/backend
@clerk/chrome-extension
@clerk/clerk-js
@clerk/electron
@clerk/electron-passkeys
@clerk/eslint-plugin
@clerk/expo
@clerk/expo-biometrics
@clerk/expo-google-signin
@clerk/expo-passkeys
@clerk/express
@clerk/fastify
@clerk/hono
@clerk/localizations
@clerk/mosaic
@clerk/nextjs
@clerk/nuxt
@clerk/react
@clerk/react-router
@clerk/shared
@clerk/tanstack-react-start
@clerk/testing
@clerk/ui
@clerk/upgrade
@clerk/vue
commit: |
Description
Card.Banneralways renders an emptyrole='alert'live region. Tests that assertedexpect(await findByRole('alert')).toHaveTextContent(...)resolved on that empty element before the error message committed, then checked its text once. On slower CI runners this races the render and fails with empty received text (seen as intermittentMosaic Feature Testsfailures, e.g.user-profile-connected-accounts.feature.test.tsx"keeps the confirmation open on a removal error and allows retrying").The 26 affected assertions now retry the text check:
Checklist
pnpm testruns as expected.pnpm buildruns as expected.Type of change