fix(ui): Fix edit button's generic aria label#8902
Conversation
🦋 Changeset detectedLatest commit: 4d48314 The changes in this PR will be included in the next version bump. This PR includes changesets to release 21 packages
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 |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository YAML (base), Repository UI (inherited) Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughAdds localized identity preview edit button labels, threads the new aria-label prop through identity preview and verification components, and updates verification flow callsites, tests, and release metadata to supply the labels. ChangesAccessible identity preview edit button labels
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
fe53fe8 to
4105a70
Compare
@clerk/astro
@clerk/backend
@clerk/chrome-extension
@clerk/clerk-js
@clerk/eslint-plugin
@clerk/expo
@clerk/expo-passkeys
@clerk/express
@clerk/fastify
@clerk/hono
@clerk/localizations
@clerk/nextjs
@clerk/nuxt
@clerk/react
@clerk/react-router
@clerk/shared
@clerk/tanstack-react-start
@clerk/testing
@clerk/ui
@clerk/upgrade
@clerk/vue
commit: |
API Changes Report
Summary
@clerk/sharedCurrent version: 4.19.0 Subpath
|
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
packages/ui/src/components/SignIn/__tests__/SignInFactorOneCodeForm.test.tsx (1)
177-213:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winAdd assertions for the new localized edit-button accessible name.
The new
identityPreviewEditButtonAriaLabelprop is now passed in fixtures, but the rendering tests only assert the code input label. Please assert the edit button’s accessible name so this accessibility behavior is actually covered.Proposed test update
it('renders phone code verification form', async () => { @@ - const { getByLabelText } = renderWithProviders(<SignInFactorOneCodeForm {...defaultProps} />, { wrapper }); + const { getByLabelText, getByRole } = renderWithProviders(<SignInFactorOneCodeForm {...defaultProps} />, { + wrapper, + }); expect(getByLabelText('Enter verification code')).toBeInTheDocument(); + expect(getByRole('button', { name: /edit phone number/i })).toBeInTheDocument(); }); it('renders email code verification form', async () => { @@ - const { getByLabelText } = renderWithProviders(<SignInFactorOneCodeForm {...emailProps} />, { wrapper }); + const { getByLabelText, getByRole } = renderWithProviders(<SignInFactorOneCodeForm {...emailProps} />, { + wrapper, + }); expect(getByLabelText('Enter verification code')).toBeInTheDocument(); + expect(getByRole('button', { name: /edit email address/i })).toBeInTheDocument(); });As per coding guidelines, “Unit tests are required for all new functionality” and tests should “Test component behavior, not implementation details.”
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/ui/src/components/SignIn/__tests__/SignInFactorOneCodeForm.test.tsx` around lines 177 - 213, The tests for the phone code verification form and email code verification form are passing the identityPreviewEditButtonAriaLabel prop but are not asserting that the edit button actually displays with the correct accessible name. Add assertions to both test cases that verify the edit button element has the expected accessible name or aria-label attribute that matches the localization key passed in the identityPreviewEditButtonAriaLabel prop. For the email code test, query for the edit button using getByLabelText or getByRole and assert it matches the expected accessible name from the localizationKeys call, and similarly update the phone code test to verify the same behavior with its respective identityPreviewEditButtonAriaLabel value from defaultProps.Source: Coding guidelines
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In
`@packages/ui/src/components/SignIn/__tests__/SignInFactorOneCodeForm.test.tsx`:
- Around line 177-213: The tests for the phone code verification form and email
code verification form are passing the identityPreviewEditButtonAriaLabel prop
but are not asserting that the edit button actually displays with the correct
accessible name. Add assertions to both test cases that verify the edit button
element has the expected accessible name or aria-label attribute that matches
the localization key passed in the identityPreviewEditButtonAriaLabel prop. For
the email code test, query for the edit button using getByLabelText or getByRole
and assert it matches the expected accessible name from the localizationKeys
call, and similarly update the phone code test to verify the same behavior with
its respective identityPreviewEditButtonAriaLabel value from defaultProps.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository YAML (base), Repository UI (inherited)
Review profile: CHILL
Plan: Pro
Run ID: 9825d062-0154-4554-be42-6e4419e3460b
📒 Files selected for processing (29)
.changeset/bright-lamps-edit-labels.mdpackages/localizations/src/en-US.tspackages/localizations/src/utils/enUS_v4.tspackages/shared/src/types/localization.tspackages/ui/src/components/SessionTasks/tasks/TaskSetupMfa/SmsCodeFlowScreen.tsxpackages/ui/src/components/SignIn/SignInFactorOneAlternativeChannelCodeForm.tsxpackages/ui/src/components/SignIn/SignInFactorOneCodeForm.tsxpackages/ui/src/components/SignIn/SignInFactorOneEmailCodeCard.tsxpackages/ui/src/components/SignIn/SignInFactorOneEmailLinkCard.tsxpackages/ui/src/components/SignIn/SignInFactorOneForgotPasswordCard.tsxpackages/ui/src/components/SignIn/SignInFactorOnePasskey.tsxpackages/ui/src/components/SignIn/SignInFactorOnePasswordCard.tsxpackages/ui/src/components/SignIn/SignInFactorOnePhoneCodeCard.tsxpackages/ui/src/components/SignIn/SignInFactorTwoCodeForm.tsxpackages/ui/src/components/SignIn/SignInFactorTwoEmailLinkCard.tsxpackages/ui/src/components/SignIn/__tests__/SignInFactorOneCodeForm.test.tsxpackages/ui/src/components/SignUp/SignUpEmailCodeCard.tsxpackages/ui/src/components/SignUp/SignUpEmailLinkCard.tsxpackages/ui/src/components/SignUp/SignUpPhoneCodeCard.tsxpackages/ui/src/components/SignUp/SignUpVerificationCodeForm.tsxpackages/ui/src/components/UserVerification/UVFactorOneCodeForm.tsxpackages/ui/src/components/UserVerification/UVFactorOneEmailCodeCard.tsxpackages/ui/src/components/UserVerification/UVFactorOnePhoneCodeCard.tsxpackages/ui/src/components/UserVerification/UVFactorTwoCodeForm.tsxpackages/ui/src/components/UserVerification/UVFactorTwoPhoneCodeCard.tsxpackages/ui/src/components/UserVerification/UserVerificationFactorTwoTOTP.tsxpackages/ui/src/elements/IdentityPreview.tsxpackages/ui/src/elements/VerificationCodeCard.tsxpackages/ui/src/elements/VerificationLinkCard.tsx
847842c to
60107bb
Compare
Description
Updates the edit buttons generic aria-label.

Before:
After:

Checklist
pnpm testruns as expected.pnpm buildruns as expected.Type of change
Summary by CodeRabbit