Only test one CustomLink to avoid map key order failing test
parent
6e59d8ce34
commit
81ada5315c
|
@ -78,7 +78,6 @@ func TestAllRoutesWithExternalLinks(t *testing.T) {
|
|||
statusFeedURL := "http://pineapple.life/feed.json"
|
||||
customLinks := map[string]string{
|
||||
"cubeapple": "https://cube.apple",
|
||||
"pinecube": "https://pine.cube",
|
||||
}
|
||||
logger := log.New(log.DebugLevel)
|
||||
handler := &AllRoutes{
|
||||
|
@ -101,7 +100,7 @@ func TestAllRoutesWithExternalLinks(t *testing.T) {
|
|||
if err := json.Unmarshal(body, &routes); err != nil {
|
||||
t.Error("TestAllRoutesWithExternalLinks not able to unmarshal JSON response")
|
||||
}
|
||||
want := `{"layouts":"/chronograf/v1/layouts","mappings":"/chronograf/v1/mappings","sources":"/chronograf/v1/sources","me":"/chronograf/v1/me","dashboards":"/chronograf/v1/dashboards","auth":[],"external":{"statusFeed":"http://pineapple.life/feed.json","custom":[{"name":"cubeapple","url":"https://cube.apple"},{"name":"pinecube","url":"https://pine.cube"}]}}
|
||||
want := `{"layouts":"/chronograf/v1/layouts","mappings":"/chronograf/v1/mappings","sources":"/chronograf/v1/sources","me":"/chronograf/v1/me","dashboards":"/chronograf/v1/dashboards","auth":[],"external":{"statusFeed":"http://pineapple.life/feed.json","custom":[{"name":"cubeapple","url":"https://cube.apple"}]}}
|
||||
`
|
||||
if want != string(body) {
|
||||
t.Errorf("TestAllRoutesWithExternalLinks\nwanted\n*%s*\ngot\n*%s*", want, string(body))
|
||||
|
|
Loading…
Reference in New Issue