diff --git a/packages/ra-ui-materialui/src/field/ReferenceArrayField.spec.tsx b/packages/ra-ui-materialui/src/field/ReferenceArrayField.spec.tsx index d5ed9e9180..88ef5e67fd 100644 --- a/packages/ra-ui-materialui/src/field/ReferenceArrayField.spec.tsx +++ b/packages/ra-ui-materialui/src/field/ReferenceArrayField.spec.tsx @@ -339,7 +339,7 @@ describe('', () => { await waitFor(() => { expect(screen.queryAllByRole('checkbox')).toHaveLength(6); }); - fireEvent.click(screen.getAllByRole('checkbox')[1]); + fireEvent.click(screen.getAllByRole('checkbox')[0]); expect( await screen.findByRole('button', { name: 'Select all' }) ).toBeDefined();