Add persistent dark mode and server-assigned content IDs
This commit is contained in:
@@ -80,7 +80,12 @@ func TestControlAuthorizationAndExecution(t *testing.T) {
|
||||
if request("GET", "/api/control", "", token, "") != 200 {
|
||||
t.Fatal("admin denied")
|
||||
}
|
||||
previewBody := `{"id":"` + game.ID() + `","expectedVersion":1,"op":"create-effect-set","reason":"Preview effects","effectSet":{"id":"test_effect","name":"Test effect","description":"","modifiers":[{"stat":"strength","flat":2,"percent":0}]}}`
|
||||
previewBody := `{"id":"` + game.ID() + `","expectedVersion":1,"op":"create-effect-set","reason":"Preview effects","effectSet":{"name":"Test effect","description":"","modifiers":[{"stat":"strength","flat":2,"percent":0}]}}`
|
||||
for _, path := range []string{"/api/control/catalog", "/api/control/catalog/preview"} {
|
||||
if request("POST", path, strings.Replace(previewBody, `"effectSet":{`, `"effectSet":{"id":"client_chosen",`, 1), token, server.URL) != 400 {
|
||||
t.Fatal("client selected a permanent content ID")
|
||||
}
|
||||
}
|
||||
if request("POST", "/api/control/catalog/preview", previewBody, token, "https://evil.example") != 403 {
|
||||
t.Fatal("cross-origin preview")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user