(t *testing.T)
| 28 | } |
| 29 | |
| 30 | func TestAPI_Health(t *testing.T) { |
| 31 | srv := newTestServer() |
| 32 | |
| 33 | req := httptest.NewRequest("GET", "/api/health", nil) |
| 34 | w := httptest.NewRecorder() |
| 35 | |
| 36 | srv.handleHealth(w, req) |
| 37 | |
| 38 | if w.Code != http.StatusOK { |
| 39 | t.Errorf("Expected 200, got %d", w.Code) |
| 40 | } |
| 41 | |
| 42 | var resp map[string]any |
| 43 | json.Unmarshal(w.Body.Bytes(), &resp) |
| 44 | |
| 45 | if resp["status"] != "ok" { |
| 46 | t.Errorf("Expected status ok, got %v", resp["status"]) |
| 47 | } |
| 48 | if v, _ := resp["version"].(string); v == "" { |
| 49 | t.Errorf("Expected non-empty version string, got %v", resp["version"]) |
| 50 | } |
| 51 | } |
| 52 | |
| 53 | func TestAPI_GetSettings(t *testing.T) { |
| 54 | srv := newTestServer() |
nothing calls this directly
no test coverage detected