feat: machine pages Порты, Статус, Изменить as dialogs over the current page; Действие column in the ports table
This commit is contained in:
1 parent
2009796421
commit
d92696226e
11 files changed
+141
-5
No files matched your search
@@ -89,3 +89,19 @@ func TestSSHFSOpen(t *testing.T) {
|
||||
t.Fatalf("a user without the machine got %d", w.Code)
|
||||
}
|
||||
}
|
||||
|
||||
// Renaming from the machine dialog keeps it open on «Изменить».
|
||||
func TestRenameStaysOnEdit(t *testing.T) {
|
||||
s, c := newTestServer(t)
|
||||
tok := "tok-test"
|
||||
var req *http.Request
|
||||
req = httptest.NewRequest(http.MethodPost, "/agents/x1/rename", strings.NewReader("csrf="+tok+"&name=new"))
|
||||
req.Header.Set("Content-Type", "application/x-www-form-urlencoded")
|
||||
req.AddCookie(c)
|
||||
req.AddCookie(&http.Cookie{Name: csrfCookie, Value: tok})
|
||||
w := httptest.NewRecorder()
|
||||
s.Handler().ServeHTTP(w, req)
|
||||
if loc := w.Header().Get("Location"); w.Code != http.StatusSeeOther || loc != "/agents/x1/edit" {
|
||||
t.Fatalf("rename: %d to %q", w.Code, loc)
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user