(t *testing.T)
| 11 | ) |
| 12 | |
| 13 | func TestRenderEntryWithBranchAndWorktree(t *testing.T) { |
| 14 | p := &PRDPicker{ |
| 15 | basePath: "/project", |
| 16 | currentPRD: "", |
| 17 | entries: []PRDEntry{ |
| 18 | { |
| 19 | Name: "auth", |
| 20 | Completed: 8, |
| 21 | Total: 8, |
| 22 | LoopState: loop.LoopStateComplete, |
| 23 | Branch: "chief/auth", |
| 24 | WorktreeDir: "/project/.chief/worktrees/auth", |
| 25 | }, |
| 26 | }, |
| 27 | } |
| 28 | |
| 29 | result := p.renderEntry(p.entries[0], false, 80) |
| 30 | if result == "" { |
| 31 | t.Fatal("expected non-empty render result") |
| 32 | } |
| 33 | // Should contain branch name |
| 34 | if !containsText(result, "chief/auth") { |
| 35 | t.Errorf("expected branch 'chief/auth' in output, got: %s", result) |
| 36 | } |
| 37 | // Should contain worktree path |
| 38 | if !containsText(result, ".chief/worktrees/auth/") { |
| 39 | t.Errorf("expected worktree path in output, got: %s", result) |
| 40 | } |
| 41 | } |
| 42 | |
| 43 | func TestRenderEntryNoBranch(t *testing.T) { |
| 44 | p := &PRDPicker{ |
nothing calls this directly
no test coverage detected