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

Function TestSet_DoneFlag_PRReviewWorkflow

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

Source from the content-addressed store, hash-verified

1351}
1352
1353func TestSet_DoneFlag_PRReviewWorkflow(t *testing.T) {
1354 tmpDir := createSetTestFiles(t)
1355 resetSetFlags()
1356 taskDir = tmpDir
1357 setDone = true
1358
1359 // Simulate pr-review workflow via viper
1360 viper.Set("workflow", "pr-review")
1361 defer viper.Set("workflow", "")
1362
1363 // Use positional arg to avoid flag state leakage
1364 output, err := captureSetOutputWithArgs(t, []string{"001"})
1365 if err != nil {
1366 t.Fatalf("unexpected error: %v", err)
1367 }
1368
1369 if !strings.Contains(output, "status: pending -> in-review") {
1370 t.Errorf("Expected --done to set status to in-review in pr-review workflow, got: %s", output)
1371 }
1372
1373 content, _ := os.ReadFile(filepath.Join(tmpDir, "001-setup.md"))
1374 if !strings.Contains(string(content), "status: in-review") {
1375 t.Error("Expected file to contain in-review status")
1376 }
1377}
1378
1379func TestSet_DependsOn(t *testing.T) {
1380 tmpDir := createSetTestFiles(t)

Callers

nothing calls this directly

Calls 4

createSetTestFilesFunction · 0.85
resetSetFlagsFunction · 0.85
captureSetOutputWithArgsFunction · 0.85
ErrorMethod · 0.80

Tested by

no test coverage detected