(t *testing.T)
| 519 | } |
| 520 | |
| 521 | func TestCleanConfirmationNavigation(t *testing.T) { |
| 522 | p := &PRDPicker{ |
| 523 | basePath: "/project", |
| 524 | entries: []PRDEntry{ |
| 525 | { |
| 526 | Name: "auth", |
| 527 | Branch: "chief/auth", |
| 528 | WorktreeDir: "/project/.chief/worktrees/auth", |
| 529 | }, |
| 530 | }, |
| 531 | selectedIndex: 0, |
| 532 | } |
| 533 | p.StartCleanConfirmation() |
| 534 | |
| 535 | // Move down to "Remove worktree only" |
| 536 | p.CleanConfirmMoveDown() |
| 537 | if p.GetCleanOption() != CleanOptionWorktreeOnly { |
| 538 | t.Errorf("expected CleanOptionWorktreeOnly after move down, got %d", p.GetCleanOption()) |
| 539 | } |
| 540 | |
| 541 | // Move down to "Cancel" |
| 542 | p.CleanConfirmMoveDown() |
| 543 | if p.GetCleanOption() != CleanOptionCancel { |
| 544 | t.Errorf("expected CleanOptionCancel after two moves down, got %d", p.GetCleanOption()) |
| 545 | } |
| 546 | |
| 547 | // Move down again - should stay at Cancel (index 2) |
| 548 | p.CleanConfirmMoveDown() |
| 549 | if p.GetCleanOption() != CleanOptionCancel { |
| 550 | t.Errorf("expected CleanOptionCancel to remain after extra move down, got %d", p.GetCleanOption()) |
| 551 | } |
| 552 | |
| 553 | // Move back up |
| 554 | p.CleanConfirmMoveUp() |
| 555 | if p.GetCleanOption() != CleanOptionWorktreeOnly { |
| 556 | t.Errorf("expected CleanOptionWorktreeOnly after move up, got %d", p.GetCleanOption()) |
| 557 | } |
| 558 | } |
| 559 | |
| 560 | func TestCleanConfirmationCancel(t *testing.T) { |
| 561 | p := &PRDPicker{ |
nothing calls this directly
no test coverage detected