testing update + docs
This commit is contained in:
@@ -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 (
|
||||
|
||||
Reference in New Issue
Block a user