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.
This commit is contained in:
2026-04-11 21:58:28 +08:00
parent b1311ea144
commit 289aab2930
11 changed files with 1630 additions and 0 deletions

View File

@@ -56,6 +56,7 @@ RBAC/admin 改动必须验证:
| `.gitattributes` | ✅ 已添加 | 统一行尾符为 LF消除 LF/CRLF 污染) |
| Swagger 注解 | ✅ 已添加 | 13 个 handler 共 86 处 `@Summary/@Description/@Tags/@Param/@Router` 注解 |
| Device Repository 测试 | ✅ 已添加 | 15 个测试用例覆盖 DeviceRepository CRUD |
| Repository 测试覆盖率 | ✅ 已提升 | 从 46.6% 提升至 74%(目标 80%|
## 最新验证结果