package plan3test import ( "errors" "net/http" "net/http/httptest" "strings" "testing" "time" "amadan.net/oficina/equipo/internal/equipo" ) func TestTeamsHierarchy(t *testing.T) { f := newFixture(t) task := f.createTask(t) custom, err := f.Store.CreateSpecialist(ctx, owner, specialistInput("Custom QA"), equipo.Mutation{RequestID: "nav-specialist"}) must(t, err) body := f.get(t, owner, "/work").Body.String() // The thin sidebar (slice 4) lists only what the thin core backs. if strings.Contains(body, `href="/specialists/`+custom.Key+`"`) { t.Fatal("an old-engine specialist page is in the navigation") } for path, up := range map[string]string{"/work": "/teams", "/conversation": "/work#nav-conversation", "/preferences": "/work#nav-preferences", "/playbooks": "/work#nav-playbooks", "/settings/coordinator": "/work#nav-coordinator", "/tasks/" + task.ID: "/journey", "/tasks/" + task.ID + "/thread": "/tasks/" + task.ID} { w := f.get(t, owner, path) expectHTTP(t, w, 200) if !strings.Contains(w.Body.String(), `href="`+up+`" rel="up"`) { t.Errorf("%s missing parent %s", path, up) } if strings.Contains(w.Body.String(), `id="nav-teams"`) { t.Errorf("%s links the old team switch", path) } } w := f.get(t, owner, "/work") nav := w.Body.String()[strings.Index(w.Body.String(), "