MCPcopy Create free account
hub / github.com/driangle/taskmd / TestHandleGraphMermaid

Function TestHandleGraphMermaid

apps/cli/internal/web/handlers_test.go:350–372  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

348}
349
350func 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
374func TestHandleStats(t *testing.T) {
375 dir := createTestTaskDir(t)

Callers

nothing calls this directly

Calls 3

createTestTaskDirFunction · 0.85
NewDataProviderFunction · 0.85
handleGraphMermaidFunction · 0.85

Tested by

no test coverage detected