(t *testing.T)
| 233 | } |
| 234 | |
| 235 | func TestCmdEditPlaybook(t *testing.T) { |
| 236 | root := setupFlowRoot(t) |
| 237 | wd := t.TempDir() |
| 238 | if rc := cmdAdd([]string{"playbook", "P", "--slug", "p", "--work-dir", wd}); rc != 0 { |
| 239 | t.Fatal() |
| 240 | } |
| 241 | t.Setenv("EDITOR", "/usr/bin/true") |
| 242 | if rc := cmdEdit([]string{"p"}); rc != 0 { |
| 243 | t.Errorf("rc=%d", rc) |
| 244 | } |
| 245 | briefPath := filepath.Join(root, "playbooks", "p", "brief.md") |
| 246 | if _, err := os.Stat(briefPath); err != nil { |
| 247 | t.Errorf("brief.md missing: %v", err) |
| 248 | } |
| 249 | |
| 250 | // updated_at should be bumped — verify the row's updated_at is recent. |
| 251 | db := openFlowDB(t) |
| 252 | pb, err := flowdb.GetPlaybook(db, "p") |
| 253 | if err != nil { |
| 254 | t.Fatal(err) |
| 255 | } |
| 256 | if pb.UpdatedAt == "" { |
| 257 | t.Errorf("UpdatedAt empty") |
| 258 | } |
| 259 | } |
nothing calls this directly
no test coverage detected