(t *testing.T)
| 74 | } |
| 75 | |
| 76 | func TestBranchWarningNoConflicts(t *testing.T) { |
| 77 | bw := NewBranchWarning() |
| 78 | bw.SetSize(80, 24) |
| 79 | bw.SetContext("feature/x", "auth", ".chief/worktrees/auth/") |
| 80 | bw.SetDialogContext(DialogNoConflicts) |
| 81 | bw.Reset() |
| 82 | |
| 83 | // Should have 3 options: run in current dir, create worktree+branch, cancel |
| 84 | if len(bw.options) != 3 { |
| 85 | t.Fatalf("expected 3 options for no conflicts, got %d", len(bw.options)) |
| 86 | } |
| 87 | |
| 88 | // First option should be "Run in current directory" (recommended) |
| 89 | if bw.options[0].option != BranchOptionContinue { |
| 90 | t.Errorf("expected first option to be Continue (current dir), got %v", bw.options[0].option) |
| 91 | } |
| 92 | if !bw.options[0].recommended { |
| 93 | t.Error("expected first option to be recommended") |
| 94 | } |
| 95 | |
| 96 | // Second option should be "Create worktree + branch" |
| 97 | if bw.options[1].option != BranchOptionCreateWorktree { |
| 98 | t.Errorf("expected second option to be CreateWorktree, got %v", bw.options[1].option) |
| 99 | } |
| 100 | |
| 101 | // Third option should be Cancel |
| 102 | if bw.options[2].option != BranchOptionCancel { |
| 103 | t.Errorf("expected third option to be Cancel, got %v", bw.options[2].option) |
| 104 | } |
| 105 | } |
| 106 | |
| 107 | func TestBranchWarningNavigation(t *testing.T) { |
| 108 | bw := NewBranchWarning() |
nothing calls this directly
no test coverage detected