test(auth): add multi-error test for empty form submission

Verifies all three validation errors (name, email, password) appear
simultaneously when submitting a completely empty form.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-02 15:07:07 +02:00
parent 6d0f00c8fb
commit 7de18740f2

View File

@@ -163,6 +163,18 @@ describe('SignupForm', () => {
expect(screen.getByText('Ungültige E-Mail-Adresse')).toBeInTheDocument();
});
it('shows all three validation errors when form submitted empty', async () => {
const user = userEvent.setup();
render(SignupForm);
const submit = screen.getByRole('button', { name: /konto erstellen/i });
await user.click(submit);
expect(screen.getByText('Name ist erforderlich')).toBeInTheDocument();
expect(screen.getByText('Ungültige E-Mail-Adresse')).toBeInTheDocument();
expect(screen.getByText('Mindestens 8 Zeichen')).toBeInTheDocument();
});
it('renders placeholders on inputs', () => {
render(SignupForm);
expect(screen.getByPlaceholderText('z.B. Sarah')).toBeInTheDocument();