diff options
| author | Peter Stone <thepeterstone@gmail.com> | 2026-03-23 08:59:35 +0000 |
|---|---|---|
| committer | Peter Stone <thepeterstone@gmail.com> | 2026-03-23 08:59:35 +0000 |
| commit | 23c670442392af1c75b935b3296ae2fc4fd094ba (patch) | |
| tree | 3137ff26aa5ed14ff8acb77007d4bc6ec2fff217 /internal/handlers/timeline_logic_test.go | |
| parent | 92c784dd057d8f110c677516909162c4cd4d00da (diff) | |
fix: support multiple enabled Google Task lists and Calendars
- Update Google API interfaces with setters for list/calendar IDs
- Update fetchCalendarEvents and fetchGoogleTasks to use enabled IDs from source_configs
- Update timeline logic tests to reflect interface changes and seed config data
- Ensure dashboard respects user-selected lists from settings
Diffstat (limited to 'internal/handlers/timeline_logic_test.go')
| -rw-r--r-- | internal/handlers/timeline_logic_test.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/internal/handlers/timeline_logic_test.go b/internal/handlers/timeline_logic_test.go index d6959da..03bc291 100644 --- a/internal/handlers/timeline_logic_test.go +++ b/internal/handlers/timeline_logic_test.go @@ -33,6 +33,8 @@ func (m *MockCalendarClient) GetCalendarList(ctx context.Context) ([]models.Cale return nil, m.Err } +func (m *MockCalendarClient) SetCalendarIDs(ids []string) {} + func setupTestStore(t *testing.T) *store.Store { t.Helper() tempDir := t.TempDir() @@ -398,6 +400,14 @@ func TestFetchCalendarEvents_CacheFallbackOnAPIError(t *testing.T) { t.Fatalf("Failed to update cache metadata: %v", err) } + // Enable the calendar in config + err = db.SyncSourceConfigs("gcal", "calendar", []models.SourceConfig{ + {Source: "gcal", ItemType: "calendar", ItemID: "e-cached", ItemName: "Cached", Enabled: true}, + }) + if err != nil { + t.Fatalf("Failed to seed calendar config: %v", err) + } + // Create handler with a failing calendar client failingCal := &MockCalendarClient{Err: fmt.Errorf("API unavailable")} h := &Handler{ |
