diff options
Diffstat (limited to 'internal/handlers/handlers_test.go')
| -rw-r--r-- | internal/handlers/handlers_test.go | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/internal/handlers/handlers_test.go b/internal/handlers/handlers_test.go index 3ea2a3e..1aa72cc 100644 --- a/internal/handlers/handlers_test.go +++ b/internal/handlers/handlers_test.go @@ -9,6 +9,7 @@ import ( "testing" "time" + "task-dashboard/internal/api" "task-dashboard/internal/config" "task-dashboard/internal/models" "task-dashboard/internal/store" @@ -82,6 +83,32 @@ func (m *mockTodoistClient) CompleteTask(ctx context.Context, taskID string) err return nil } +func (m *mockTodoistClient) Sync(ctx context.Context, syncToken string) (*api.TodoistSyncResponse, error) { + if m.err != nil { + return nil, m.err + } + // Return a mock sync response with tasks converted to sync items + items := make([]api.SyncItemResponse, 0, len(m.tasks)) + for _, task := range m.tasks { + items = append(items, api.SyncItemResponse{ + ID: task.ID, + Content: task.Content, + Description: task.Description, + ProjectID: task.ProjectID, + Priority: task.Priority, + Labels: task.Labels, + IsCompleted: task.Completed, + IsDeleted: false, + }) + } + return &api.TodoistSyncResponse{ + SyncToken: "test-sync-token", + FullSync: true, + Items: items, + Projects: []api.SyncProjectResponse{}, + }, nil +} + // mockTrelloClient creates a mock Trello client for testing type mockTrelloClient struct { boards []models.Board |
