Task
Write comprehensive test cases for the LoginForm component located at src/components/features/auth/LoginForm/LoginForm.tsx using Vitest and React Testing Library.
Requirements
- Test rendering of LoginForm component
- Validate email and password input fields
- Test submit button and loading state
- Validate error messaging (
props.error)
- Confirm
onLogin and onError callbacks are triggered correctly
- Ensure accessibility for form elements (
getByRole, getByLabelText)
- Cover edge cases (empty values, disabled states)
Guidelines
- Follow project TDD standards (Red-Green-Refactor cycle)
- Place the test file as
LoginForm.test.tsx in the same directory as the component
- Use semantic queries (
getByRole, getByLabelText, etc.) and AAA pattern
- Reference the main component source code
Assignee
@KARUNANS2004 will be responsible for implementing these tests.