package uiserver import ( "encoding/json" "io/ioutil" "net/http" "net/http/httptest" "net/url" "os" "path/filepath" "regexp" "testing" "github.com/hashicorp/consul/agent/config" "github.com/hashicorp/consul/sdk/testutil" "github.com/stretchr/testify/require" ) func TestUIServerIndex(t *testing.T) { cases := []struct { name string cfg *config.RuntimeConfig path string tx UIDataTransform wantStatus int wantContains []string wantNotContains []string wantEnv map[string]interface{} wantUICfgJSON string }{ { name: "basic UI serving", cfg: basicUIEnabledConfig(), path: "/", // Note /index.html redirects to / wantStatus: http.StatusOK, wantContains: []string{"