feat(admin-panel): update url
feat(admin-panel): update some of the ui feat(oauth-screen): make oauth success screen match the rest of the app
This commit is contained in:
parent
3db5ec25c2
commit
f6ed4f1e2e
8 changed files with 79 additions and 34 deletions
|
|
@ -1529,7 +1529,7 @@ func TestHomeEnabledHidesManagementEndpointsAndControlPanel(t *testing.T) {
|
|||
})
|
||||
|
||||
t.Run("management control panel returns 404", func(t *testing.T) {
|
||||
req := httptest.NewRequest(http.MethodGet, "/management.html", nil)
|
||||
req := httptest.NewRequest(http.MethodGet, "/admin", nil)
|
||||
rr := httptest.NewRecorder()
|
||||
server.engine.ServeHTTP(rr, req)
|
||||
if rr.Code != http.StatusNotFound {
|
||||
|
|
@ -1566,27 +1566,27 @@ func TestExampleAPIKeySafeModeShowsWarningAndKeepsManagement(t *testing.T) {
|
|||
t.Fatalf("status = %d, want %d body=%s", rr.Code, http.StatusOK, rr.Body.String())
|
||||
}
|
||||
body := rr.Body.String()
|
||||
for _, want := range []string{"Example API key detected", "Open Management", `href="/management.html?safe-mode=configure"`} {
|
||||
for _, want := range []string{"Example API key detected", "Open Management", `href="/admin?safe-mode=configure"`} {
|
||||
if !strings.Contains(body, want) {
|
||||
t.Fatalf("warning page missing %q: %s", want, body)
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
t.Run("management html defaults to warning page", func(t *testing.T) {
|
||||
req := httptest.NewRequest(http.MethodGet, "/management.html", nil)
|
||||
t.Run("admin defaults to warning page", func(t *testing.T) {
|
||||
req := httptest.NewRequest(http.MethodGet, "/admin", nil)
|
||||
rr := httptest.NewRecorder()
|
||||
server.engine.ServeHTTP(rr, req)
|
||||
if rr.Code != http.StatusOK {
|
||||
t.Fatalf("status = %d, want %d body=%s", rr.Code, http.StatusOK, rr.Body.String())
|
||||
}
|
||||
if !strings.Contains(rr.Body.String(), "Example API key detected") {
|
||||
t.Fatalf("management.html did not show warning page: %s", rr.Body.String())
|
||||
t.Fatalf("admin page did not show warning page: %s", rr.Body.String())
|
||||
}
|
||||
})
|
||||
|
||||
t.Run("management html head stops at warning page", func(t *testing.T) {
|
||||
req := httptest.NewRequest(http.MethodHead, "/management.html", nil)
|
||||
t.Run("admin head stops at warning page", func(t *testing.T) {
|
||||
req := httptest.NewRequest(http.MethodHead, "/admin", nil)
|
||||
rr := httptest.NewRecorder()
|
||||
server.engine.ServeHTTP(rr, req)
|
||||
if rr.Code != http.StatusOK {
|
||||
|
|
@ -1601,7 +1601,7 @@ func TestExampleAPIKeySafeModeShowsWarningAndKeepsManagement(t *testing.T) {
|
|||
})
|
||||
|
||||
t.Run("management button query opens control panel", func(t *testing.T) {
|
||||
req := httptest.NewRequest(http.MethodGet, "/management.html?safe-mode=configure", nil)
|
||||
req := httptest.NewRequest(http.MethodGet, "/admin?safe-mode=configure", nil)
|
||||
rr := httptest.NewRecorder()
|
||||
server.engine.ServeHTTP(rr, req)
|
||||
if rr.Code != http.StatusOK {
|
||||
|
|
@ -1643,7 +1643,7 @@ func TestExampleAPIKeySafeModeShowsWarningAndKeepsManagement(t *testing.T) {
|
|||
if strings.Contains(rr.Body.String(), "management_url") {
|
||||
t.Fatalf("body should not include management_url field: %s", rr.Body.String())
|
||||
}
|
||||
if !strings.Contains(rr.Body.String(), "/management.html?safe-mode=configure") {
|
||||
if !strings.Contains(rr.Body.String(), "/admin?safe-mode=configure") {
|
||||
t.Fatalf("body missing management link in message: %s", rr.Body.String())
|
||||
}
|
||||
if got := rr.Header().Get(internallogging.CPATraceIDHeader); got != "" {
|
||||
|
|
|
|||
Loading…
Reference in a new issue