diff options
| author | Doot Agent <agent@doot.local> | 2026-07-06 00:00:59 +0000 |
|---|---|---|
| committer | Doot Agent <agent@doot.local> | 2026-07-06 00:00:59 +0000 |
| commit | 945c34590677e161a711ccaff0e1077197b1b178 (patch) | |
| tree | df26e8ba5a369b3323649c2fab95bd8e7a49b58e /internal/handlers/agent_test.go | |
| parent | cd14604bbef17f696475cf8737f1e41c9fa2dd06 (diff) | |
feat: remove Todoist integration entirely
Native tasks (native_tasks table) fully replace Todoist. All Todoist
API code, store functions, handlers, routes, templates, and tests have
been removed. Migration 021 drops the now-unused tasks cache table.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'internal/handlers/agent_test.go')
| -rw-r--r-- | internal/handlers/agent_test.go | 26 |
1 files changed, 11 insertions, 15 deletions
diff --git a/internal/handlers/agent_test.go b/internal/handlers/agent_test.go index eab1609..2893a13 100644 --- a/internal/handlers/agent_test.go +++ b/internal/handlers/agent_test.go @@ -746,13 +746,11 @@ func TestHandleAgentTaskWriteOperations(t *testing.T) { defer cleanup() // Mock clients - mockTodoist := &mockTodoistClient{} mockTrello := &mockTrelloClient{} h := &Handler{ - store: db, - todoistClient: mockTodoist, - trelloClient: mockTrello, - config: &config.Config{}, + store: db, + trelloClient: mockTrello, + config: &config.Config{}, } // Create an approved session @@ -766,11 +764,11 @@ func TestHandleAgentTaskWriteOperations(t *testing.T) { db.CreateAgentSession(session) db.ApproveAgentSession("write-request-token", sessionToken, time.Now().Add(1*time.Hour)) - // Pre-populate store with a task to get details during completion - db.SaveTasks([]models.Task{{ID: "task123", Content: "Test Task"}}) + // Pre-populate store with a native task + _ = db.CreateNativeTask(models.Task{ID: "task123", Content: "Test Task"}) t.Run("complete task", func(t *testing.T) { - req := httptest.NewRequest(http.MethodPost, "/agent/tasks/task123/complete?source=todoist", nil) + req := httptest.NewRequest(http.MethodPost, "/agent/tasks/task123/complete?source=doot", nil) w := httptest.NewRecorder() // Manually inject session into context as middleware would @@ -804,7 +802,7 @@ func TestHandleAgentTaskWriteOperations(t *testing.T) { t.Run("update due date", func(t *testing.T) { due := time.Now().Add(24 * time.Hour) body, _ := json.Marshal(map[string]*time.Time{"due": &due}) - req := httptest.NewRequest(http.MethodPatch, "/agent/tasks/task123/due?source=todoist", bytes.NewReader(body)) + req := httptest.NewRequest(http.MethodPatch, "/agent/tasks/task123/due?source=doot", bytes.NewReader(body)) w := httptest.NewRecorder() rctx := chi.NewRouteContext() @@ -820,7 +818,7 @@ func TestHandleAgentTaskWriteOperations(t *testing.T) { t.Run("update task details", func(t *testing.T) { body, _ := json.Marshal(map[string]string{"title": "Updated Title", "description": "New Desc"}) - req := httptest.NewRequest(http.MethodPatch, "/agent/tasks/task123?source=todoist", bytes.NewReader(body)) + req := httptest.NewRequest(http.MethodPatch, "/agent/tasks/task123?source=doot", bytes.NewReader(body)) w := httptest.NewRecorder() rctx := chi.NewRouteContext() @@ -839,17 +837,15 @@ func TestHandleAgentCreateOperations(t *testing.T) { db, cleanup := setupTestDB(t) defer cleanup() - mockTodoist := &mockTodoistClient{} h := &Handler{ - store: db, - todoistClient: mockTodoist, - config: &config.Config{}, + store: db, + config: &config.Config{}, } t.Run("create task", func(t *testing.T) { body, _ := json.Marshal(map[string]string{ "title": "New Agent Task", - "source": "todoist", + "source": "doot", }) req := httptest.NewRequest(http.MethodPost, "/agent/tasks", bytes.NewReader(body)) w := httptest.NewRecorder() |
