This commit is contained in:
2026-08-17 02:12:17 +08:00
parent 560ae46b82
commit 6a05803e08
96 changed files with 2888 additions and 685 deletions
+16
View File
@@ -0,0 +1,16 @@
package service
import (
"testing"
"kra/internal/biz"
)
func TestDepartmentResponsePreservesNilAndEmptyChildren(t *testing.T) {
if got := departmentResponse(&biz.Department{}).Children; got != nil {
t.Fatalf("single/search department children = %#v, want nil", got)
}
if got := departmentResponse(&biz.Department{Children: []*biz.Department{}}).Children; got == nil || len(got) != 0 {
t.Fatalf("tree leaf children = %#v, want empty slice", got)
}
}