Implement Login page with PocketBase auth (P1.6)

Add functional login page with email/password form:
- Client component with controlled form inputs
- PocketBase authentication integration
- Error handling with visual feedback
- Loading states (disabled inputs, button text change)
- Form validation (prevents empty submissions)
- Redirect to dashboard on successful login

Test infrastructure improvements:
- Add @testing-library/jest-dom for DOM matchers
- Add global test setup with cleanup between tests
- Configure vitest.config.ts with setupFiles

14 new tests covering form rendering, auth flow, error
handling, and validation.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-01-10 19:19:50 +00:00
parent 18c34916ca
commit 933e39aed4
7 changed files with 451 additions and 9 deletions

10
src/test-setup.ts Normal file
View File

@@ -0,0 +1,10 @@
// ABOUTME: Test setup file that configures testing utilities.
// ABOUTME: Imports jest-dom matchers and sets up cleanup after each test.
import "@testing-library/jest-dom/vitest";
import { cleanup } from "@testing-library/react";
import { afterEach } from "vitest";
// Cleanup after each test to avoid component accumulation
afterEach(() => {
cleanup();
});