- webhook_service_test.go: isPrivateIP, isSafeURL, computeHMAC - request_metadata_test.go: context functions - classified_error_test.go: error types - config_defaults_test.go: password reset/SMS defaults - email_config_test.go: email code defaults - auth_runtime_test.go: isUserNotFoundError Service coverage: 11.2% -> 14.7%
31 lines
888 B
Go
31 lines
888 B
Go
package service
|
|
|
|
import (
|
|
"testing"
|
|
"time"
|
|
)
|
|
|
|
// =============================================================================
|
|
// Email Configuration Tests
|
|
// =============================================================================
|
|
|
|
func TestDefaultEmailCodeConfig(t *testing.T) {
|
|
cfg := DefaultEmailCodeConfig()
|
|
|
|
if cfg.CodeTTL != 5*time.Minute {
|
|
t.Errorf("CodeTTL = %v, want %v", cfg.CodeTTL, 5*time.Minute)
|
|
}
|
|
if cfg.ResendCooldown != time.Minute {
|
|
t.Errorf("ResendCooldown = %v, want %v", cfg.ResendCooldown, time.Minute)
|
|
}
|
|
if cfg.MaxDailyLimit != 10 {
|
|
t.Errorf("MaxDailyLimit = %d, want 10", cfg.MaxDailyLimit)
|
|
}
|
|
if cfg.SiteURL != "http://localhost:8080" {
|
|
t.Errorf("SiteURL = %q, want %q", cfg.SiteURL, "http://localhost:8080")
|
|
}
|
|
if cfg.SiteName != "User Management System" {
|
|
t.Errorf("SiteName = %q, want %q", cfg.SiteName, "User Management System")
|
|
}
|
|
}
|