TASK-3585: idempotency keys on comment create.
(t *testing.T)
| 10 | |
| 11 | // TASK-3585: idempotency keys on comment create. |
| 12 | func commentKeyFixture(t *testing.T) (*Server, string) { |
| 13 | t.Helper() |
| 14 | srv := testServer(t) |
| 15 | slug := createWSWithCollections(t, srv) |
| 16 | rr := doRequest(srv, "POST", "/api/v1/workspaces/"+slug+"/collections/tasks/items", map[string]any{"title": "Commented on", "fields": `{"status":"open"}`}) |
| 17 | if rr.Code != http.StatusCreated { |
| 18 | t.Fatalf("item: %d %s", rr.Code, rr.Body.String()) |
| 19 | } |
| 20 | var it models.Item |
| 21 | _ = json.Unmarshal(rr.Body.Bytes(), &it) |
| 22 | return srv, "/api/v1/workspaces/" + slug + "/items/" + it.Slug + "/comments" |
| 23 | } |
| 24 | |
| 25 | func countComments(t *testing.T, srv *Server, path, body string) int { |
| 26 | t.Helper() |
no test coverage detected