Skip to content

test(mosaic): wait for alert text instead of the first alert element - #10080

Merged
alexcarpenter merged 3 commits into
mainfrom
carp/mosaic-alert-text-flake
Oct 5, 2026
Merged

alexcarpenter merged 3 commits into
mainfrom
carp/mosaic-alert-text-flake

Conversation

@alexcarpenter

Copy link
Copy Markdown
Member

Description

Card.Banner always renders an empty role='alert' live region. Tests that asserted expect(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 intermittent Mosaic Feature Tests failures, 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:

await waitFor(() => expect(screen.getByRole('alert')).toHaveTextContent('...'));

Checklist

  • pnpm test runs as expected.
  • pnpm build runs as expected.
  • (If applicable) JSDoc comments have been added or updated for any package exports
  • (If applicable) Documentation has been updated

Type of change

  • 🐛 Bug fix
  • 🌟 New feature
  • 🔨 Breaking change
  • 📖 Refactoring / dependency upgrade / documentation
  • other: test flake fix

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.
@vercel

vercel Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
clerk-js-sandbox Ready Ready Preview Oct 5, 2026 9:50pm UTC
swingset Ready Ready Preview Oct 5, 2026 9:50pm UTC

Request Review

@changeset-bot

changeset-bot Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 2f955ee

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 0 packages

When 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

@coderabbitai

coderabbitai Bot commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

⚙️ Run configuration
  • Configuration used: Repository YAML (base), Organization UI (inherited)
  • Review profile: ASSERTIVE
  • Plan: Team
  • Run ID: d61362b0-4c66-453f-8a76-ba8757e6da27
📥 Commits

Reviewing files that changed from the base of the PR and between 57da181 and 2f955ee.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository YAML (base), Organization UI (inherited)
  • Review profile: ASSERTIVE
  • Plan: Team
  • Run ID: 07d8bfea-53da-4b79-8129-5b4f3e21da50
📥 Commits

Reviewing files that changed from the base of the PR and between aad46e3 and 57da181.

📒 Files selected for processing (14)
  • .changeset/mosaic-alert-text-flake.md
  • packages/mosaic/src/features/organization-profile/__tests__/invitations-table-tab.view.test.tsx
  • packages/mosaic/src/features/organization-profile/__tests__/organization-profile-general-panel.view.test.tsx
  • packages/mosaic/src/features/organization-profile/__tests__/requests-table-tab.view.test.tsx
  • packages/mosaic/src/features/user-profile/__tests__/user-profile-account-section.integration.test.tsx
  • packages/mosaic/src/features/user-profile/__tests__/user-profile-connected-accounts.feature.test.tsx
  • packages/mosaic/src/features/user-profile/__tests__/user-profile-device-actions.test.tsx
  • packages/mosaic/src/features/user-profile/__tests__/user-profile-email-actions.test.tsx
  • packages/mosaic/src/features/user-profile/__tests__/user-profile-enterprise-accounts-contract.feature.test.tsx
  • packages/mosaic/src/features/user-profile/__tests__/user-profile-enterprise-accounts.feature.test.tsx
  • packages/mosaic/src/features/user-profile/__tests__/user-profile-mfa-section.view.test.tsx
  • packages/mosaic/src/features/user-profile/__tests__/user-profile-passkeys-section.view.test.tsx
  • packages/mosaic/src/features/user-profile/__tests__/user-profile-phone-actions.test.tsx
  • packages/mosaic/src/features/user-profile/__tests__/user-profile-picture-row.view.test.tsx
🔗 Linked repositories identified

CodeRabbit 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.


📝 Walkthrough

Walkthrough

Organization-profile and user-profile tests now use waitFor with synchronous alert queries to check expected error text. The expected messages and other test assertions remain unchanged. The changeset file contains empty frontmatter.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested reviewers: austincalvelage

Merge Risk: ⚪ Minimal · up to 57da1

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)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the test change: waiting for alert text instead of resolving on the first alert element.
Description check ✅ Passed The description explains the empty alert live-region race and the test updates that wait for the expected text.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@pkg-pr-new

pkg-pr-new Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

@clerk/astro

npm i https://pkg.pr.new/@clerk/astro@10080

@clerk/backend

npm i https://pkg.pr.new/@clerk/backend@10080

@clerk/chrome-extension

npm i https://pkg.pr.new/@clerk/chrome-extension@10080

@clerk/clerk-js

npm i https://pkg.pr.new/@clerk/clerk-js@10080

@clerk/electron

npm i https://pkg.pr.new/@clerk/electron@10080

@clerk/electron-passkeys

npm i https://pkg.pr.new/@clerk/electron-passkeys@10080

@clerk/eslint-plugin

npm i https://pkg.pr.new/@clerk/eslint-plugin@10080

@clerk/expo

npm i https://pkg.pr.new/@clerk/expo@10080

@clerk/expo-biometrics

npm i https://pkg.pr.new/@clerk/expo-biometrics@10080

@clerk/expo-google-signin

npm i https://pkg.pr.new/@clerk/expo-google-signin@10080

@clerk/expo-passkeys

npm i https://pkg.pr.new/@clerk/expo-passkeys@10080

@clerk/express

npm i https://pkg.pr.new/@clerk/express@10080

@clerk/fastify

npm i https://pkg.pr.new/@clerk/fastify@10080

@clerk/hono

npm i https://pkg.pr.new/@clerk/hono@10080

@clerk/localizations

npm i https://pkg.pr.new/@clerk/localizations@10080

@clerk/mosaic

npm i https://pkg.pr.new/@clerk/mosaic@10080

@clerk/nextjs

npm i https://pkg.pr.new/@clerk/nextjs@10080

@clerk/nuxt

npm i https://pkg.pr.new/@clerk/nuxt@10080

@clerk/react

npm i https://pkg.pr.new/@clerk/react@10080

@clerk/react-router

npm i https://pkg.pr.new/@clerk/react-router@10080

@clerk/shared

npm i https://pkg.pr.new/@clerk/shared@10080

@clerk/tanstack-react-start

npm i https://pkg.pr.new/@clerk/tanstack-react-start@10080

@clerk/testing

npm i https://pkg.pr.new/@clerk/testing@10080

@clerk/ui

npm i https://pkg.pr.new/@clerk/ui@10080

@clerk/upgrade

npm i https://pkg.pr.new/@clerk/upgrade@10080

@clerk/vue

npm i https://pkg.pr.new/@clerk/vue@10080

commit: 2f955ee

@alexcarpenter
alexcarpenter merged commit 2a7d261 into main Oct 5, 2026
51 checks passed
@alexcarpenter
alexcarpenter deleted the carp/mosaic-alert-text-flake branch October 5, 2026 21:51

This branch was successfully deployed

2 active deployments
Preview – swingset — 2f955ee2 Deployed Oct 5, 2026 by vercel[bot]
Preview – clerk-js-sandbox — 2f955ee2 Deployed Oct 5, 2026 by vercel[bot]
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.

2 participants