Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/components/BatchSend/BatchForm.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,15 @@ describe('BatchForm', () => {
await waitFor(() => expect(onSubmit).toHaveBeenCalledTimes(1))
expect(onSubmit.mock.calls[0][0].recipients).toHaveLength(2)
})
it('renders accessible names for recipient inputs', () => {
render(<BatchForm onSubmit={vi.fn()} supportedAssets={assets} />)

fireEvent.click(screen.getByRole('button', { name: /add recipient/i }))

expect(screen.getByRole('textbox', { name: /recipient 1 address/i })).toBeInTheDocument()
expect(screen.getByRole('spinbutton', { name: /recipient 1 amount/i })).toBeInTheDocument()

expect(screen.getByRole('textbox', { name: /recipient 2 address/i })).toBeInTheDocument()
expect(screen.getByRole('spinbutton', { name: /recipient 2 amount/i })).toBeInTheDocument()
})
})
3 changes: 3 additions & 0 deletions src/components/BatchSend/BatchForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,15 @@ export function BatchForm({
>
<div className="flex-1 space-y-2">
<Input
aria-label={`Recipient ${index + 1} address`}
placeholder="G... recipient address"
fullWidth
error={errors.recipients?.[index]?.destinationAddress?.message}
{...register(`recipients.${index}.destinationAddress` as const)}
/>

<Input
aria-label={`Recipient ${index + 1} amount`}
placeholder="Amount"
type="number"
min="0"
Expand Down