testing update + docs

This commit is contained in:
2026-03-02 10:16:55 +00:00
parent 803aab7073
commit eac5dccc3c
14 changed files with 203 additions and 405 deletions
+19
View File
@@ -1,6 +1,25 @@
//go:build test
// +build test
// Package auth contains tests for authentication and verification endpoints.
//
// Test Coverage:
// - RegisterHandler: POST /api/register - User registration
// * Validates: required fields, email format, UK phone, age >= 16, duplicate email
// - LoginHandler: POST /api/login - User login
// * Validates credentials, returns JWT token
// - RefreshTokenHandler: POST /api/refresh-token - Refresh JWT token
// - GenerateVerificationCodeHandler: POST /api/verify/generate - Send verification code
// * Returns success even for non-existent emails (security)
// - VerifyCodeHandler: POST /api/verify/check - Verify code and update user role
// * Validates: correct code, not expired, not already used
// * Updates user role from unverified_email to verified_email on success
//
// Validation: Comprehensive tests for invalid inputs (bad email, bad phone, underage, etc.)
package auth
//go:build test
// +build test
package auth
import (