Files
KanzlAI-mGMT/Makefile
m 325fbeb5de test: comprehensive E2E and API test suite for full KanzlAI stack
Backend (Go):
- Expanded integration_test.go: health, auth middleware (expired/invalid/wrong-secret JWT),
  tenant CRUD, case CRUD (create/list/get/update/delete + filters + validation),
  deadline CRUD (create/list/update/complete/delete), appointment CRUD,
  dashboard (verifies all sections), deadline calculator (valid/invalid/unknown type),
  proceeding types & rules, document endpoints, AI extraction (no-key path),
  and full critical path E2E (auth -> case -> deadline -> appointment -> dashboard -> complete)
- New handler unit tests: case (10), appointment (11), dashboard (1), calculate (5),
  document (10), AI (4) — all testing validation, auth guards, and error paths without DB
- Total: ~80 backend tests (unit + integration)

Frontend (TypeScript/Vitest):
- Installed vitest 2.x, @testing-library/react, @testing-library/jest-dom, jsdom 24, msw
- vitest.config.ts with jsdom env, esbuild JSX automatic, path aliases
- API client tests (13): URL construction, no double /api/, auth header, tenant header,
  POST/PUT/PATCH/DELETE methods, error handling, 204 responses
- DeadlineTrafficLights tests (5): renders cards, correct counts, zero state, onFilter callback
- CaseOverviewGrid tests (4): renders categories, counts, header, zero state
- LoginPage tests (8): form rendering, mode toggle, password login, redirect, error display,
  magic link, registration link
- Total: 30 frontend tests

Makefile: test-frontend target now runs vitest instead of placeholder echo.
2026-03-25 16:19:00 +01:00

46 lines
849 B
Makefile

.PHONY: dev dev-backend dev-frontend build build-backend build-frontend lint lint-backend lint-frontend test test-backend test-frontend clean
# Development
dev:
@echo "Start backend and frontend separately:"
@echo " make dev-backend"
@echo " make dev-frontend"
dev-backend:
cd backend && go run ./cmd/server
dev-frontend:
cd frontend && bun run dev
# Build
build: build-backend build-frontend
build-backend:
cd backend && go build -o bin/server ./cmd/server
build-frontend:
cd frontend && bun run build
# Lint
lint: lint-backend lint-frontend
lint-backend:
cd backend && go vet ./...
lint-frontend:
cd frontend && bun run lint
# Test
test: test-backend test-frontend
test-backend:
cd backend && go test ./...
test-frontend:
cd frontend && bun run test
# Clean
clean:
rm -rf backend/bin
rm -rf frontend/.next frontend/out