package handlers import ( "net/http" "strings" "testing" ) // TestAgentsPage checks that the public agent guide renders for anonymous visitors. func TestAgentsPage(t *testing.T) { app, _, _, _ := setupTestApp(t) status, body := getPage(t, app, "/agents") if status != http.StatusOK { t.Fatalf("GET /agents status %d", status) } for _, want := range []string{ "Polar for AI agents", "RFC 8628", "/api/v1/device/code", "/api/v1/device/token", "polar_session", "releases/new", "git-credential-polar", } { if !strings.Contains(body, want) { t.Errorf("/agents page body missing %q", want) } } if !strings.Contains(body, "AI agents · Polar") { t.Errorf("/agents page title should be \"AI agents · Polar\"") } }