(t *testing.T)
| 126 | } |
| 127 | |
| 128 | func TestCreateAgentUnregisteredDomain(t *testing.T) { |
| 129 | srv := testServer(t) |
| 130 | // The security-critical guard: an agent cannot be created on a domain |
| 131 | // the caller has not registered + verified. |
| 132 | code, body := postJSON(t, srv.URL+"/v1/agents", "good", map[string]any{ |
| 133 | "email": "bot@someone-elses.com", |
| 134 | }) |
| 135 | if code != 400 || errCode(body) != "domain_not_registered" { |
| 136 | t.Fatalf("want 400 domain_not_registered, got %d %v", code, body) |
| 137 | } |
| 138 | } |
| 139 | |
| 140 | func TestCreateAgentDuplicate(t *testing.T) { |
| 141 | srv := testServer(t) |
nothing calls this directly
no test coverage detected