diff options
Diffstat (limited to 'internal/handlers/handlers_test.go')
| -rw-r--r-- | internal/handlers/handlers_test.go | 35 |
1 files changed, 0 insertions, 35 deletions
diff --git a/internal/handlers/handlers_test.go b/internal/handlers/handlers_test.go index 1aa72cc..6e9346a 100644 --- a/internal/handlers/handlers_test.go +++ b/internal/handlers/handlers_test.go @@ -353,41 +353,6 @@ func TestHandleRefresh(t *testing.T) { // The important thing is the handler doesn't error } -// TestHandleGetNotes tests the HandleGetNotes handler -func TestHandleGetNotes(t *testing.T) { - db, cleanup := setupTestDB(t) - defer cleanup() - - // Test with nil client should return empty array - cfg := &config.Config{ - CacheTTLMinutes: 5, - } - h := &Handler{ - store: db, - obsidianClient: nil, - config: cfg, - } - - req := httptest.NewRequest("GET", "/api/notes", nil) - w := httptest.NewRecorder() - - h.HandleGetNotes(w, req) - - if w.Code != http.StatusOK { - t.Errorf("Expected status 200, got %d", w.Code) - } - - var notes []models.Note - if err := json.NewDecoder(w.Body).Decode(¬es); err != nil { - t.Fatalf("Failed to decode response: %v", err) - } - - // Handler returns empty array when client is nil - if len(notes) != 0 { - t.Errorf("Expected 0 notes when client is nil, got %d", len(notes)) - } -} - // TestHandleGetMeals tests the HandleGetMeals handler func TestHandleGetMeals(t *testing.T) { db, cleanup := setupTestDB(t) |
