Skip to content

Commit a30406b

Browse files
committed
fix: Improve accessibility for profile photo upload by adding aria-label and update test to use getByLabel
1 parent 046a738 commit a30406b

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

app/routes/settings+/profile.photo.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@ export default function PhotoRoute({
167167
className="peer sr-only"
168168
required
169169
tabIndex={newImageSrc ? -1 : 0}
170+
aria-label="Change"
170171
onChange={(e) => {
171172
const file = e.currentTarget.files?.[0]
172173
if (file) {

tests/e2e/settings-profile.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ test('Users can update their profile photo', async ({ page, login }) => {
6363
await expect(page).toHaveURL(`/settings/profile/photo`)
6464

6565
await page
66-
.getByRole('textbox', { name: /change/i })
66+
.getByLabel(/change/i)
6767
.setInputFiles('./tests/fixtures/images/user/kody.png')
6868

6969
await page.getByRole('button', { name: /save/i }).click()

0 commit comments

Comments
 (0)