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

Function TestSettingsOverlay_ApplyToConfig

internal/tui/settings_test.go:40–62  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

38}
39
40func TestSettingsOverlay_ApplyToConfig(t *testing.T) {
41 s := NewSettingsOverlay()
42 cfg := config.Default()
43 s.LoadFromConfig(cfg)
44
45 // Modify items
46 s.items[0].StringVal = "go mod download"
47 s.items[1].BoolVal = true
48 s.items[2].BoolVal = true
49
50 resultCfg := config.Default()
51 s.ApplyToConfig(resultCfg)
52
53 if resultCfg.Worktree.Setup != "go mod download" {
54 t.Errorf("expected setup='go mod download', got '%s'", resultCfg.Worktree.Setup)
55 }
56 if !resultCfg.OnComplete.Push {
57 t.Error("expected push=true")
58 }
59 if !resultCfg.OnComplete.CreatePR {
60 t.Error("expected createPR=true")
61 }
62}
63
64func TestSettingsOverlay_Navigation(t *testing.T) {
65 s := NewSettingsOverlay()

Callers

nothing calls this directly

Calls 4

LoadFromConfigMethod · 0.95
ApplyToConfigMethod · 0.95
DefaultFunction · 0.92
NewSettingsOverlayFunction · 0.85

Tested by

no test coverage detected