test: add comprehensive test coverage and improve code quality
- Add new test files for auth, service, and handler modules - Improve test organization and coverage - Refactor code for better maintainability - Add captcha, settings, stats, and theme handler tests - Add auth module tests (CAS, OAuth, password, SSO, state) - Add service layer tests for auth, export, permissions, roles - All Go tests pass (exit code 0) - All frontend tests pass (325 tests in 59 files)
This commit is contained in:
@@ -91,8 +91,8 @@ func main() {
|
||||
socialRepo,
|
||||
jwtManager,
|
||||
cacheManager,
|
||||
8, // passwordMinLength
|
||||
5, // maxLoginAttempts
|
||||
8, // passwordMinLength
|
||||
5, // maxLoginAttempts
|
||||
15*time.Minute, // loginLockDuration
|
||||
)
|
||||
authService.SetRoleRepositories(userRoleRepo, roleRepo)
|
||||
@@ -142,9 +142,6 @@ func main() {
|
||||
jwtManager,
|
||||
userRepo,
|
||||
userRoleRepo,
|
||||
roleRepo,
|
||||
rolePermissionRepo,
|
||||
permissionRepo,
|
||||
l1Cache,
|
||||
)
|
||||
authMiddleware.SetCacheManager(cacheManager)
|
||||
@@ -164,7 +161,7 @@ func main() {
|
||||
exportHandler := handler.NewExportHandler(exportService)
|
||||
statsHandler := handler.NewStatsHandler(statsService)
|
||||
passwordResetHandler := handler.NewPasswordResetHandler(passwordResetService)
|
||||
smsHandler := handler.NewSMSHandler()
|
||||
smsHandler := handler.NewSMSHandler(authService, nil)
|
||||
avatarHandler := handler.NewAvatarHandler(userRepo)
|
||||
customFieldHandler := handler.NewCustomFieldHandler(customFieldService)
|
||||
themeHandler := handler.NewThemeHandler(themeService)
|
||||
|
||||
Reference in New Issue
Block a user