(t *testing.T)
| 309 | } |
| 310 | |
| 311 | func 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 | |
| 348 | func TestSet_AllValidStatuses(t *testing.T) { |
| 349 | statuses := []string{"pending", "in-progress", "completed", "in-review", "blocked", "cancelled"} |
nothing calls this directly
no test coverage detected