From 8ca1f686bd7d495322a36b5260ce7a303505d8b9 Mon Sep 17 00:00:00 2001 From: Peter Stone Date: Wed, 15 Jul 2026 02:13:28 +0000 Subject: chore: remove dead code (unused atom constants, orphaned handler) - SourceMeal/TypeMeal (AtomSource/AtomType): leftover from the removed MealToAtom conversion (b2d8fc4); zero references anywhere else. - HandleGetSourceOptions: never registered as a route, and its own test comment already noted "may fail if template not found, which is acceptable" -- the settings-source-options template it rendered doesn't exist in web/templates/ at all. Fully unreachable/broken, not just unused. go build/vet/test all clean, no behavior change for anything reachable. Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_01VTUSAEKfsPc6WGDq45yPHD --- internal/handlers/handlers_test.go | 42 -------------------------------------- 1 file changed, 42 deletions(-) (limited to 'internal/handlers/handlers_test.go') diff --git a/internal/handlers/handlers_test.go b/internal/handlers/handlers_test.go index 1f66378..d16c7cf 100644 --- a/internal/handlers/handlers_test.go +++ b/internal/handlers/handlers_test.go @@ -1343,48 +1343,6 @@ func TestHandleToggleSourceConfig_MissingFields(t *testing.T) { } } -func TestHandleGetSourceOptions(t *testing.T) { - h, cleanup := setupTestHandler(t) - defer cleanup() - - // Create source configs - _ = h.store.SyncSourceConfigs("trello", "board", []models.SourceConfig{ - {Source: "trello", ItemType: "board", ItemID: "board1", ItemName: "Board 1"}, - {Source: "trello", ItemType: "board", ItemID: "board2", ItemName: "Board 2"}, - }) - - req := httptest.NewRequest("GET", "/settings/source/trello", nil) - rctx := chi.NewRouteContext() - rctx.URLParams.Add("source", "trello") - req = req.WithContext(context.WithValue(req.Context(), chi.RouteCtxKey, rctx)) - - w := httptest.NewRecorder() - - h.HandleGetSourceOptions(w, req) - - // May fail if template not found, which is acceptable in test - if w.Code != http.StatusOK && w.Code != http.StatusInternalServerError { - t.Errorf("Expected status 200 or 500, got %d", w.Code) - } -} - -func TestHandleGetSourceOptions_MissingSource(t *testing.T) { - h, cleanup := setupTestHandler(t) - defer cleanup() - - req := httptest.NewRequest("GET", "/settings/source/", nil) - rctx := chi.NewRouteContext() - req = req.WithContext(context.WithValue(req.Context(), chi.RouteCtxKey, rctx)) - - w := httptest.NewRecorder() - - h.HandleGetSourceOptions(w, req) - - if w.Code != http.StatusBadRequest { - t.Errorf("Expected status 400, got %d", w.Code) - } -} - // mockTrelloClientWithBoards returns mock boards type mockTrelloClientWithBoards struct { mockTrelloClient -- cgit v1.2.3