(t *testing.T)
| 242 | } |
| 243 | |
| 244 | func TestSettingsOverlay_Render(t *testing.T) { |
| 245 | s := NewSettingsOverlay() |
| 246 | cfg := &config.Config{ |
| 247 | Worktree: config.WorktreeConfig{Setup: "npm install"}, |
| 248 | OnComplete: config.OnCompleteConfig{ |
| 249 | Push: true, |
| 250 | CreatePR: false, |
| 251 | }, |
| 252 | } |
| 253 | s.LoadFromConfig(cfg) |
| 254 | s.SetSize(80, 24) |
| 255 | |
| 256 | rendered := s.Render() |
| 257 | |
| 258 | // Check header |
| 259 | if !strings.Contains(rendered, "Settings") { |
| 260 | t.Error("expected 'Settings' in header") |
| 261 | } |
| 262 | if !strings.Contains(rendered, ".chief/config.yaml") { |
| 263 | t.Error("expected config path in header") |
| 264 | } |
| 265 | |
| 266 | // Check section headers |
| 267 | if !strings.Contains(rendered, "Worktree") { |
| 268 | t.Error("expected 'Worktree' section") |
| 269 | } |
| 270 | if !strings.Contains(rendered, "On Complete") { |
| 271 | t.Error("expected 'On Complete' section") |
| 272 | } |
| 273 | |
| 274 | // Check values |
| 275 | if !strings.Contains(rendered, "npm install") { |
| 276 | t.Error("expected 'npm install' value") |
| 277 | } |
| 278 | if !strings.Contains(rendered, "Yes") { |
| 279 | t.Error("expected 'Yes' for push") |
| 280 | } |
| 281 | if !strings.Contains(rendered, "No") { |
| 282 | t.Error("expected 'No' for createPR") |
| 283 | } |
| 284 | |
| 285 | // Check footer |
| 286 | if !strings.Contains(rendered, "Esc: close") { |
| 287 | t.Error("expected 'Esc: close' in footer") |
| 288 | } |
| 289 | } |
| 290 | |
| 291 | func TestSettingsOverlay_RenderGHError(t *testing.T) { |
| 292 | s := NewSettingsOverlay() |
nothing calls this directly
no test coverage detected