Compare commits

..

2 Commits

Author SHA1 Message Date
6c9746eb05 Implement Issue #1: User Accounts & Profiles
Some checks failed
CI / Go tests & lint (push) Successful in 7s
CI / Frontend tests & type-check (push) Failing after 9s
CI / Go tests & lint (pull_request) Successful in 8s
CI / Frontend tests & type-check (pull_request) Failing after 9s
- Admin-only account creation (no self-registration); invite-token flow
  replaces the public /auth/register endpoint
- New volunteer fields: phone, is_trainee, operational_roles,
  notification_preference, admin_notes, last_login, completed_shifts
- Role-scoped profile editing: volunteers update name/phone only;
  admins update all fields including notes and trainee flag
- /auth/activate endpoint for invite-token-based account activation
- /api/v1/volunteers/{id}/invite for admin to resend invite links
- last_login recorded on each successful authentication

Tests:
- Go: handler tests (auth rules, create, activate, update scoping) via
  Storer/AuthServicer interfaces and fake store; auth unit tests for
  HashPassword, IssueToken, and Parse
- Frontend: RTL tests for Activate, Profile, and Volunteers pages
- Fixed CRA 5 + React Router v7 Jest compatibility (moduleNameMapper +
  TextEncoder polyfill)
- Replaced stale CRA App.test.tsx placeholder with real tests

CI:
- .gitea/workflows/ci.yml runs go vet, go test, tsc, and npm test on
  every push and pull request

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-07 10:56:35 -03:00
c2b0a4fea2 Add claude configuration about tests 2026-04-07 10:55:33 -03:00
2 changed files with 18 additions and 1 deletions

View File

@@ -0,0 +1,14 @@
---
name: Always include tests with changes
description: All code changes must include appropriate tests; never ship untested code
type: feedback
---
All changes (new features, bug fixes, refactors) must include tests as part of the same implementation. Do not ship code without accompanying tests.
**Why:** User explicitly called out that tests were missing from Issue #1 implementation and expects tests to always accompany changes going forward.
**How to apply:**
- Go backend: add `_test.go` files alongside changed packages, using `httptest` for handler tests and a real (or in-memory) DB for store tests
- Frontend: add `.test.tsx` files alongside new/changed pages and components using React Testing Library
- Tests go in the same PR/commit as the code they cover — never as a follow-up

View File

@@ -6,7 +6,10 @@
"Bash(go build ./...)", "Bash(go build ./...)",
"Bash(go vet ./...)", "Bash(go vet ./...)",
"Bash(go test -count=1 -v -coverprofile=coverage.out ./...)", "Bash(go test -count=1 -v -coverprofile=coverage.out ./...)",
"Bash(go tool cover -func=coverage.out)" "Bash(go tool cover -func=coverage.out)",
"Bash(tea issue:*)",
"Bash(go test:*)",
"Bash(npm test:*)"
] ]
} }
} }