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

Function TestHandleUpdateTask_NotFound

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

Source from the content-addressed store, hash-verified

474}
475
476func TestHandleUpdateTask_NotFound(t *testing.T) {
477 dir := createTestTaskDir(t)
478 dp := NewDataProvider(dir, false)
479
480 body := strings.NewReader(`{"status":"completed"}`)
481 req := httptest.NewRequest(http.MethodPut, "/api/tasks/999", body)
482 req.SetPathValue("id", "999")
483 rec := httptest.NewRecorder()
484
485 handleUpdateTask(dp, false)(rec, req)
486
487 if rec.Code != http.StatusNotFound {
488 t.Fatalf("expected 404, got %d", rec.Code)
489 }
490}
491
492func TestHandleUpdateTask_InvalidStatus(t *testing.T) {
493 dir := createTestTaskDir(t)

Callers

nothing calls this directly

Calls 3

createTestTaskDirFunction · 0.85
NewDataProviderFunction · 0.85
handleUpdateTaskFunction · 0.85

Tested by

no test coverage detected