(t *testing.T)
| 479 | } |
| 480 | |
| 481 | func 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 | |
| 521 | func TestCleanConfirmationNavigation(t *testing.T) { |
| 522 | p := &PRDPicker{ |
nothing calls this directly
no test coverage detected