diff options
| author | Peter Stone <thepeterstone@gmail.com> | 2026-03-07 23:54:00 +0000 |
|---|---|---|
| committer | Peter Stone <thepeterstone@gmail.com> | 2026-03-08 06:27:34 +0000 |
| commit | c6ce11e17af9a4b62bbbc082e5f13bb3a3b656a6 (patch) | |
| tree | 51de63ad4bf6ca2825405dc408ec319f107bf533 /internal | |
| parent | 7bd258e8f356e66147d975dfddee23f0adc5c5c1 (diff) | |
test(api): update elaborate and validate tests to use AgentConfig
Diffstat (limited to 'internal')
| -rw-r--r-- | internal/api/elaborate_test.go | 8 | ||||
| -rw-r--r-- | internal/api/validate_test.go | 8 |
2 files changed, 9 insertions, 7 deletions
diff --git a/internal/api/elaborate_test.go b/internal/api/elaborate_test.go index 52f7fdf..4939701 100644 --- a/internal/api/elaborate_test.go +++ b/internal/api/elaborate_test.go @@ -53,7 +53,8 @@ func TestElaborateTask_Success(t *testing.T) { task := elaboratedTask{ Name: "Run Go tests with race detector", Description: "Runs the Go test suite with -race flag and checks coverage.", - Claude: elaboratedClaude{ + Agent: elaboratedAgent{ + Type: "claude", Model: "sonnet", Instructions: "Run go test -race ./... and report results.", WorkingDir: "", @@ -94,7 +95,7 @@ func TestElaborateTask_Success(t *testing.T) { if result.Name == "" { t.Error("expected non-empty name") } - if result.Claude.Instructions == "" { + if result.Agent.Instructions == "" { t.Error("expected non-empty instructions") } } @@ -127,7 +128,8 @@ func TestElaborateTask_MarkdownFencedJSON(t *testing.T) { task := elaboratedTask{ Name: "Test task", Description: "Does something.", - Claude: elaboratedClaude{ + Agent: elaboratedAgent{ + Type: "claude", Model: "sonnet", Instructions: "Do the thing.", MaxBudgetUSD: 0.5, diff --git a/internal/api/validate_test.go b/internal/api/validate_test.go index 5a1246b..c3d7b1f 100644 --- a/internal/api/validate_test.go +++ b/internal/api/validate_test.go @@ -23,7 +23,7 @@ func TestValidateTask_Success(t *testing.T) { wrapperJSON, _ := json.Marshal(wrapper) srv.validateCmdPath = createFakeClaude(t, string(wrapperJSON), 0) - body := `{"name":"Test Task","claude":{"instructions":"Run go test ./... and report results."}}` + body := `{"name":"Test Task","agent":{"instructions":"Run go test ./... and report results."}}` req := httptest.NewRequest("POST", "/api/tasks/validate", bytes.NewBufferString(body)) req.Header.Set("Content-Type", "application/json") w := httptest.NewRecorder() @@ -46,7 +46,7 @@ func TestValidateTask_Success(t *testing.T) { func TestValidateTask_MissingInstructions(t *testing.T) { srv, _ := testServer(t) - body := `{"name":"Test Task","claude":{"instructions":""}}` + body := `{"name":"Test Task","agent":{"instructions":""}}` req := httptest.NewRequest("POST", "/api/tasks/validate", bytes.NewBufferString(body)) req.Header.Set("Content-Type", "application/json") w := httptest.NewRecorder() @@ -61,7 +61,7 @@ func TestValidateTask_MissingInstructions(t *testing.T) { func TestValidateTask_MissingName(t *testing.T) { srv, _ := testServer(t) - body := `{"name":"","claude":{"instructions":"Do something useful."}}` + body := `{"name":"","agent":{"instructions":"Do something useful."}}` req := httptest.NewRequest("POST", "/api/tasks/validate", bytes.NewBufferString(body)) req.Header.Set("Content-Type", "application/json") w := httptest.NewRecorder() @@ -77,7 +77,7 @@ func TestValidateTask_BadJSONFromClaude(t *testing.T) { srv, _ := testServer(t) srv.validateCmdPath = createFakeClaude(t, "not valid json at all", 0) - body := `{"name":"Test Task","claude":{"instructions":"Do something useful."}}` + body := `{"name":"Test Task","agent":{"instructions":"Do something useful."}}` req := httptest.NewRequest("POST", "/api/tasks/validate", bytes.NewBufferString(body)) req.Header.Set("Content-Type", "application/json") w := httptest.NewRecorder() |
