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

Function TestCleanConfirmationDialog

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

Source from the content-addressed store, hash-verified

479}
480
481func TestCleanConfirmationDialog(t *testing.T) {
482 p := &PRDPicker{
483 basePath: "/project",
484 entries: []PRDEntry{
485 {
486 Name: "auth",
487 Completed: 8,
488 Total: 8,
489 LoopState: loop.LoopStateComplete,
490 Branch: "chief/auth",
491 WorktreeDir: "/project/.chief/worktrees/auth",
492 },
493 },
494 selectedIndex: 0,
495 }
496
497 // Start clean confirmation
498 p.StartCleanConfirmation()
499
500 if !p.HasCleanConfirmation() {
501 t.Fatal("expected HasCleanConfirmation() to return true after start")
502 }
503
504 cc := p.GetCleanConfirmation()
505 if cc.EntryName != "auth" {
506 t.Errorf("expected EntryName 'auth', got %q", cc.EntryName)
507 }
508 if cc.Branch != "chief/auth" {
509 t.Errorf("expected Branch 'chief/auth', got %q", cc.Branch)
510 }
511 if cc.SelectedIdx != 0 {
512 t.Errorf("expected SelectedIdx 0, got %d", cc.SelectedIdx)
513 }
514
515 // Default selection is RemoveAll
516 if p.GetCleanOption() != CleanOptionRemoveAll {
517 t.Errorf("expected CleanOptionRemoveAll by default, got %d", p.GetCleanOption())
518 }
519}
520
521func TestCleanConfirmationNavigation(t *testing.T) {
522 p := &PRDPicker{

Callers

nothing calls this directly

Calls 4

HasCleanConfirmationMethod · 0.95
GetCleanConfirmationMethod · 0.95
GetCleanOptionMethod · 0.95

Tested by

no test coverage detected