fix: address code review findings

This commit is contained in:
2026-08-17 21:50:37 +03:00
parent 9c402c0086
commit 777fda95a3
6 changed files with 76 additions and 23 deletions

View File

@@ -67,7 +67,7 @@ func TestHandlerCityAutocomplete(t *testing.T) {
t.Errorf("expected status 200, got %d", rr.Code)
}
var resp []cityResponse
var resp cityResponse
if err := json.Unmarshal(rr.Body.Bytes(), &resp); err != nil {
t.Fatalf("failed to unmarshal response: %v", err)
}
@@ -398,6 +398,9 @@ func TestHandlerStationStatus(t *testing.T) {
}
func TestAdminAuth(t *testing.T) {
// Set admin API key for tests
t.Setenv("TRIP_PLANNER_ADMIN_API_KEY", "trip-planner-admin-key")
h := newMockHandlerContext()
// Test 1: Request without API key should be unauthorized
@@ -437,6 +440,9 @@ func TestAdminAuth(t *testing.T) {
}
func TestAdminStationStatus(t *testing.T) {
// Set admin API key for tests
t.Setenv("TRIP_PLANNER_ADMIN_API_KEY", "trip-planner-admin-key")
h := newMockHandlerContext()
// Set up a station in the graph