summaryrefslogtreecommitdiff
path: root/internal/handlers/timeline_logic_test.go
diff options
context:
space:
mode:
authorPeter Stone <thepeterstone@gmail.com>2026-03-23 08:13:02 +0000
committerPeter Stone <thepeterstone@gmail.com>2026-03-23 08:13:02 +0000
commitb2d8fc460be3105ac383098e7cdc92171e5026ec (patch)
treecd5ba3f3008e6b3310680d785880f1f32ed090c5 /internal/handlers/timeline_logic_test.go
parentb0688c8819da1b7fcb4a97b6ec1fa58050e4841e (diff)
feat: unify Google Tasks with main system via caching and integrated UI
- Implement SQLite caching layer for Google Tasks - Integrate Google Tasks into unified Atoms loop (showing in Tasks tab) - Update Planning tab to include cached Google Tasks - Enhance Quick Add form with Todoist project selector - Remove orphaned HandleTasksTab/HandleRefreshTab methods - Update tests to reflect new BuildTimeline signature and data structures
Diffstat (limited to 'internal/handlers/timeline_logic_test.go')
-rw-r--r--internal/handlers/timeline_logic_test.go21
1 files changed, 16 insertions, 5 deletions
diff --git a/internal/handlers/timeline_logic_test.go b/internal/handlers/timeline_logic_test.go
index 8104a96..d6959da 100644
--- a/internal/handlers/timeline_logic_test.go
+++ b/internal/handlers/timeline_logic_test.go
@@ -90,6 +90,17 @@ func setupTestStore(t *testing.T) *store.Store {
html_link TEXT,
updated_at DATETIME DEFAULT CURRENT_TIMESTAMP
);
+ CREATE TABLE IF NOT EXISTS google_tasks (
+ id TEXT PRIMARY KEY,
+ title TEXT NOT NULL,
+ notes TEXT,
+ status TEXT NOT NULL,
+ completed BOOLEAN NOT NULL DEFAULT 0,
+ due_date DATETIME,
+ updated_at DATETIME,
+ list_id TEXT NOT NULL,
+ url TEXT
+ );
`
if err := os.WriteFile(filepath.Join(migrationDir, "001_init.sql"), []byte(schema), 0644); err != nil {
t.Fatalf("Failed to write migration file: %v", err)
@@ -143,7 +154,7 @@ func TestBuildTimeline(t *testing.T) {
start := time.Date(2023, 1, 1, 0, 0, 0, 0, time.UTC)
end := time.Date(2023, 1, 2, 0, 0, 0, 0, time.UTC)
- items, err := BuildTimeline(context.Background(), s, nil, start, end)
+ items, err := BuildTimeline(context.Background(), s, start, end)
if err != nil {
t.Fatalf("BuildTimeline failed: %v", err)
}
@@ -277,7 +288,7 @@ func TestBuildTimeline_IncludesOverdueItems(t *testing.T) {
// Query range: today through tomorrow
end := today.AddDate(0, 0, 1)
- items, err := BuildTimeline(context.Background(), s, nil,today, end)
+ items, err := BuildTimeline(context.Background(), s, today, end)
if err != nil {
t.Fatalf("BuildTimeline failed: %v", err)
}
@@ -320,7 +331,7 @@ func TestBuildTimeline_ExcludesCompletedOverdue(t *testing.T) {
{ID: "done1", Content: "Done overdue", DueDate: &yesterday, Completed: true},
})
- items, err := BuildTimeline(context.Background(), s, nil,today, end)
+ items, err := BuildTimeline(context.Background(), s, today, end)
if err != nil {
t.Fatalf("BuildTimeline failed: %v", err)
}
@@ -348,7 +359,7 @@ func TestBuildTimeline_ReadsCalendarEventsFromStore(t *testing.T) {
}
// Call BuildTimeline with NO calendar client (nil) — events should come from store
- items, err := BuildTimeline(context.Background(), s, nil,start, end)
+ items, err := BuildTimeline(context.Background(), s, start, end)
if err != nil {
t.Fatalf("BuildTimeline failed: %v", err)
}
@@ -473,7 +484,7 @@ func TestBuildTimeline_IncludesUndatedTodoistTasks(t *testing.T) {
start := time.Date(2023, 1, 1, 0, 0, 0, 0, time.UTC)
end := time.Date(2023, 1, 2, 0, 0, 0, 0, time.UTC)
- items, err := BuildTimeline(context.Background(), s, nil, start, end)
+ items, err := BuildTimeline(context.Background(), s, start, end)
if err != nil {
t.Fatalf("BuildTimeline failed: %v", err)
}