From 686c330708d75ebf89e307715c5dbe8065f66f36 Mon Sep 17 00:00:00 2001 From: Molecule AI Fullstack Engineer Date: Thu, 14 May 2026 12:54:20 +0000 Subject: [PATCH] fix(handlers): remove 3 duplicate test declarations blocking CI build (closes #968) PR #961 only partially removed duplicate test declarations. Remove the remaining 3 from org_helpers_security_test.go that already exist in org_helpers_pure_test.go: - TestIsSafeRoleName_Valid - TestMergeCategoryRouting_EmptyListDropsCategory - TestMergeCategoryRouting_EmptyKeySkipped Co-Authored-By: Claude Opus 4.7 --- .../handlers/org_helpers_security_test.go | 44 ------------------- 1 file changed, 44 deletions(-) diff --git a/workspace-server/internal/handlers/org_helpers_security_test.go b/workspace-server/internal/handlers/org_helpers_security_test.go index 6fc4f83e..2adbc22f 100644 --- a/workspace-server/internal/handlers/org_helpers_security_test.go +++ b/workspace-server/internal/handlers/org_helpers_security_test.go @@ -138,23 +138,6 @@ func TestResolveInsideRoot_SiblingNotEscaped(t *testing.T) { // ── isSafeRoleName ──────────────────────────────────────────────────────────── -func TestIsSafeRoleName_Valid(t *testing.T) { - valid := []string{ - "backend", - "Frontend-Engineer", - "research_lead", - "devOps123", - "a", - "A", - "team_42-leads", - } - for _, name := range valid { - if !isSafeRoleName(name) { - t.Errorf("isSafeRoleName(%q): expected true, got false", name) - } - } -} - func TestIsSafeRoleName_Empty(t *testing.T) { if isSafeRoleName("") { t.Error("isSafeRoleName(\"\"): expected false, got true") @@ -268,33 +251,6 @@ func TestMergeCategoryRouting_WsOverrideDropsDefault(t *testing.T) { } } -func TestMergeCategoryRouting_EmptyListDropsCategory(t *testing.T) { - defaultRouting := map[string][]string{ - "security": {"Backend Engineer"}, - "ui": {"Frontend Engineer"}, - } - wsRouting := map[string][]string{ - "security": {}, // empty list = opt out - } - got := mergeCategoryRouting(defaultRouting, wsRouting) - if _, exists := got["security"]; exists { - t.Error("empty ws list should delete the category from output") - } - if len(got["ui"]) != 1 { - t.Errorf("ui should still exist: got %v", got["ui"]) - } -} - -func TestMergeCategoryRouting_EmptyKeySkipped(t *testing.T) { - defaultRouting := map[string][]string{ - "": {"Backend Engineer"}, - } - got := mergeCategoryRouting(defaultRouting, nil) - if _, exists := got[""]; exists { - t.Error("empty key should be skipped") - } -} - func TestMergeCategoryRouting_EmptyRolesInDefaultSkipped(t *testing.T) { defaultRouting := map[string][]string{ "security": {},