TestUpdateAgentName exercises the post-reshape agent PATCH: the only mutable field is the display name (screening config moved to /protection).
(t *testing.T)
| 28 | // TestUpdateAgentName exercises the post-reshape agent PATCH: the only mutable |
| 29 | // field is the display name (screening config moved to /protection). |
| 30 | func TestUpdateAgentName(t *testing.T) { |
| 31 | srv := testServer(t) |
| 32 | code, body := sendJSON(t, "PATCH", srv.URL+"/v1/agents/support%40acme.com", "good", map[string]any{ |
| 33 | "name": "Renamed Support", |
| 34 | }) |
| 35 | if code != 200 { |
| 36 | t.Fatalf("status %d body %v", code, body) |
| 37 | } |
| 38 | // Returns the reloaded agent. |
| 39 | if body["email"] != "support@acme.com" { |
| 40 | t.Fatalf("expected reloaded agent, got %v", body) |
| 41 | } |
| 42 | } |
| 43 | |
| 44 | func TestUpdateAgentNoFields(t *testing.T) { |
| 45 | srv := testServer(t) |
nothing calls this directly
no test coverage detected