Commit Graph

6 Commits

Author SHA1 Message Date
582ad7a069 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)
2026-04-17 20:43:50 +08:00
1929c42e35 test: add comprehensive ListCursor tests with keyword, time range, and role filters 2026-04-11 22:26:18 +08:00
8257897bf5 test: add tests for GetPermissionsByIDs, GetUserRolesAndPermissions, ListCursor
Repository test coverage improved to 80.4%

- role_permission_repository_test.go: GetPermissionsByIDs test
- user_role_repository_test.go: GetUserRolesAndPermissions test
- user_repository_test.go: ListCursor test
2026-04-11 22:19:44 +08:00
289aab2930 test: add repository tests to improve coverage from 46.6% to 74%
New test files:
- custom_field_repository_test.go: 10 tests for CustomFieldRepository & UserCustomFieldValueRepository
- login_log_repository_test.go: 3 tests for ListCursor, ListByUserIDCursor, ListAllForExport
- operation_log_repository_test.go: 1 test for ListCursor
- role_repository_test.go: 2 tests for GetAncestorIDs, GetAncestors
- social_account_repository_test.go: 8 CRUD tests
- theme_repository_test.go: 10 tests for ThemeConfigRepository
- user_role_repository_test.go: 1 test for DeleteByUserAndRole

Modified test files:
- device_repository_test.go: Added ListAllCursor tests
- user_repository_test.go: Added AdvancedSearch tests
- webhook_repository_test.go: Added ListByCreatorPaginated test

Updated documentation with new coverage status.
2026-04-11 21:58:28 +08:00
3548b69aaa test: add comprehensive UserRepository coverage tests
Added tests for UserRepository operations:
- TestUserRepository_GetByPhone
- TestUserRepository_ListByStatus
- TestUserRepository_UpdateStatus
- TestUserRepository_BatchUpdateStatus
- TestUserRepository_BatchDelete
- TestUserRepository_Search
- TestUserRepository_Search_LikePattern (tests LIKE escape)

repository package coverage: 46% → 47.2%
2026-04-09 09:57:58 +08:00
dcc1f186f8 feat: backend core - auth, user, role, permission, device, webhook, monitoring, cache, repository, service, middleware, API handlers 2026-04-02 11:19:50 +08:00