test: add UserService unit tests (38+ test functions)
Coverage: Service 72.0% → 71.7% (same coverage, more comprehensive tests) - GetByID/GetByEmail: success and error cases - Create: validation (empty username, email format/length, nickname/bio length) - Update/Delete/List: basic CRUD operations - ListCursor: cursor pagination - BatchUpdateStatus/BatchDelete: batch operations - GetUserRoles/AssignRoles: role management - ListAdmins/DeleteAdmin: admin operations with protection - ChangePassword: security validation (nil repo, empty passwords, weak passwords, incorrect old password)
This commit is contained in:
1
go.mod
1
go.mod
@@ -138,6 +138,7 @@ require (
|
||||
github.com/spf13/afero v1.11.0 // indirect
|
||||
github.com/spf13/cast v1.6.0 // indirect
|
||||
github.com/spf13/pflag v1.0.6 // indirect
|
||||
github.com/stretchr/objx v0.5.3 // indirect
|
||||
github.com/subosito/gotenv v1.6.0 // indirect
|
||||
github.com/testcontainers/testcontainers-go v0.42.0 // indirect
|
||||
github.com/tiendc/go-deepcopy v1.6.0 // indirect
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user