MCPcopy Create free account
hub / github.com/MiniCodeMonkey/chief / TestCleanConfirmationNavigation

Function TestCleanConfirmationNavigation

internal/tui/picker_test.go:521–558  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

519}
520
521func 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
560func TestCleanConfirmationCancel(t *testing.T) {
561 p := &PRDPicker{

Callers

nothing calls this directly

Calls 4

CleanConfirmMoveDownMethod · 0.95
GetCleanOptionMethod · 0.95
CleanConfirmMoveUpMethod · 0.95

Tested by

no test coverage detected