From ed6a0a9b640aa6d2dafd90e67ce5950f32a42826 Mon Sep 17 00:00:00 2001 From: kingbitnation Date: Sun, 28 Jun 2026 13:22:55 +0100 Subject: [PATCH 1/2] fix(a11y): associate Token and Memo labels in RemittanceForm Wire label htmlFor to matching control ids so screen readers and tests can resolve accessible names for the token select and memo textarea. Closes #1230 --- .../components/remittance/RemittanceForm.test.tsx | 10 +++------- .../src/app/components/remittance/RemittanceForm.tsx | 12 ++++++++++-- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/frontend/src/app/components/remittance/RemittanceForm.test.tsx b/frontend/src/app/components/remittance/RemittanceForm.test.tsx index 4df20894..336453d6 100644 --- a/frontend/src/app/components/remittance/RemittanceForm.test.tsx +++ b/frontend/src/app/components/remittance/RemittanceForm.test.tsx @@ -116,9 +116,7 @@ describe("RemittanceForm", () => { await user.type(addressInput, VALID_ADDRESS); await user.type(amountInput, "100"); - const memoInput = screen.getByPlaceholderText( - "Add a note for the recipient (max 28 characters)", - ); + const memoInput = screen.getByLabelText(/^Memo/); // Use fireEvent.change to bypass the textarea's maxLength attribute fireEvent.change(memoInput, { target: { value: "This is a very long memo that exceeds the limit" }, @@ -136,9 +134,7 @@ describe("RemittanceForm", () => { const user = userEvent.setup(); render(); - const memoInput = screen.getByPlaceholderText( - "Add a note for the recipient (max 28 characters)", - ); + const memoInput = screen.getByLabelText(/^Memo/); await user.type(memoInput, "Test memo"); await waitFor(() => { @@ -150,7 +146,7 @@ describe("RemittanceForm", () => { const user = userEvent.setup(); render(); - const tokenSelect = screen.getByDisplayValue("USDC"); + const tokenSelect = screen.getByLabelText(/^Token/); expect(tokenSelect).toBeInTheDocument(); await user.selectOptions(tokenSelect, "EURC"); diff --git a/frontend/src/app/components/remittance/RemittanceForm.tsx b/frontend/src/app/components/remittance/RemittanceForm.tsx index 63b67704..667e964c 100644 --- a/frontend/src/app/components/remittance/RemittanceForm.tsx +++ b/frontend/src/app/components/remittance/RemittanceForm.tsx @@ -170,10 +170,14 @@ export function RemittanceForm({ onSuccess }: RemittanceFormProps) { {/* Token Selection */}
-