(t *testing.T)
| 348 | } |
| 349 | |
| 350 | func TestHandleGraphMermaid(t *testing.T) { |
| 351 | dir := createTestTaskDir(t) |
| 352 | dp := NewDataProvider(dir, false) |
| 353 | |
| 354 | req := httptest.NewRequest(http.MethodGet, "/api/graph/mermaid", nil) |
| 355 | rec := httptest.NewRecorder() |
| 356 | |
| 357 | handleGraphMermaid(dp)(rec, req) |
| 358 | |
| 359 | if rec.Code != http.StatusOK { |
| 360 | t.Fatalf("expected 200, got %d", rec.Code) |
| 361 | } |
| 362 | |
| 363 | body := rec.Body.String() |
| 364 | if len(body) == 0 { |
| 365 | t.Fatal("expected non-empty mermaid output") |
| 366 | } |
| 367 | |
| 368 | ct := rec.Header().Get("Content-Type") |
| 369 | if ct != "text/plain" { |
| 370 | t.Fatalf("expected text/plain, got %s", ct) |
| 371 | } |
| 372 | } |
| 373 | |
| 374 | func TestHandleStats(t *testing.T) { |
| 375 | dir := createTestTaskDir(t) |
nothing calls this directly
no test coverage detected