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

Function TestBranchWarningPathHints

internal/tui/branch_warning_test.go:205–221  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

203}
204
205func TestBranchWarningPathHints(t *testing.T) {
206 bw := NewBranchWarning()
207 bw.SetSize(80, 24)
208 bw.SetContext("main", "auth", ".chief/worktrees/auth/")
209 bw.SetDialogContext(DialogProtectedBranch)
210
211 // Check that options have correct path hints
212 if bw.options[0].hint != "./ (current directory)" {
213 t.Errorf("expected current dir hint for branch only, got %q", bw.options[0].hint)
214 }
215 if bw.options[1].hint != ".chief/worktrees/auth/" {
216 t.Errorf("expected worktree path hint, got %q", bw.options[1].hint)
217 }
218 if bw.options[2].hint != "./ (current directory)" {
219 t.Errorf("expected current dir hint for continue, got %q", bw.options[2].hint)
220 }
221}
222
223func TestBranchWarningRender(t *testing.T) {
224 // Test that Render doesn't panic for each context

Callers

nothing calls this directly

Calls 4

SetSizeMethod · 0.95
SetContextMethod · 0.95
SetDialogContextMethod · 0.95
NewBranchWarningFunction · 0.85

Tested by

no test coverage detected