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

Function TestSet_MultipleFields

apps/cli/internal/cli/set_test.go:311–346  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

309}
310
311func TestSet_MultipleFields(t *testing.T) {
312 tmpDir := createSetTestFiles(t)
313 resetSetFlags()
314 taskDir = tmpDir
315 setTaskID = "003"
316 setStatus = "in-progress"
317 setPriority = "critical"
318 setEffort = "large"
319
320 output, err := captureSetOutput(t)
321 if err != nil {
322 t.Fatalf("unexpected error: %v", err)
323 }
324
325 if !strings.Contains(output, "status: blocked -> in-progress") {
326 t.Error("Expected status change in output")
327 }
328 if !strings.Contains(output, "priority: medium -> critical") {
329 t.Error("Expected priority change in output")
330 }
331 if !strings.Contains(output, "effort: medium -> large") {
332 t.Error("Expected effort change in output")
333 }
334
335 content, _ := os.ReadFile(filepath.Join(tmpDir, "003-ui.md"))
336 fileStr := string(content)
337 if !strings.Contains(fileStr, "status: in-progress") {
338 t.Error("Expected file to contain updated status")
339 }
340 if !strings.Contains(fileStr, "priority: critical") {
341 t.Error("Expected file to contain updated priority")
342 }
343 if !strings.Contains(fileStr, "effort: large") {
344 t.Error("Expected file to contain updated effort")
345 }
346}
347
348func TestSet_AllValidStatuses(t *testing.T) {
349 statuses := []string{"pending", "in-progress", "completed", "in-review", "blocked", "cancelled"}

Callers

nothing calls this directly

Calls 4

createSetTestFilesFunction · 0.85
resetSetFlagsFunction · 0.85
captureSetOutputFunction · 0.85
ErrorMethod · 0.80

Tested by

no test coverage detected