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

Function TestWorktreeSpinnerRender

internal/tui/worktree_spinner_test.go:140–171  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

138}
139
140func TestWorktreeSpinnerRender(t *testing.T) {
141 s := NewWorktreeSpinner()
142 s.Configure("auth", "chief/auth", "main", ".chief/worktrees/auth/", "npm install")
143 s.SetSize(80, 24)
144
145 rendered := s.Render()
146
147 // Should contain the title
148 if !strings.Contains(rendered, "Setting up worktree") {
149 t.Error("rendered output should contain title")
150 }
151
152 // Should contain branch name
153 if !strings.Contains(rendered, "chief/auth") {
154 t.Error("rendered output should contain branch name")
155 }
156
157 // Should contain worktree path
158 if !strings.Contains(rendered, ".chief/worktrees/auth/") {
159 t.Error("rendered output should contain worktree path")
160 }
161
162 // Should contain setup command
163 if !strings.Contains(rendered, "npm install") {
164 t.Error("rendered output should contain setup command")
165 }
166
167 // Should contain Esc hint
168 if !strings.Contains(rendered, "Esc") {
169 t.Error("rendered output should contain Esc hint")
170 }
171}
172
173func TestWorktreeSpinnerRenderComplete(t *testing.T) {
174 s := NewWorktreeSpinner()

Callers

nothing calls this directly

Calls 4

ConfigureMethod · 0.95
SetSizeMethod · 0.95
RenderMethod · 0.95
NewWorktreeSpinnerFunction · 0.85

Tested by

no test coverage detected