diff options
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{ |
