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

Function TestSettingsOverlay_ToggleBool

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

Source from the content-addressed store, hash-verified

99}
100
101func TestSettingsOverlay_ToggleBool(t *testing.T) {
102 s := NewSettingsOverlay()
103 cfg := &config.Config{
104 OnComplete: config.OnCompleteConfig{Push: false},
105 }
106 s.LoadFromConfig(cfg)
107
108 // Select "Push to remote" (index 1)
109 s.MoveDown()
110
111 key, val := s.ToggleBool()
112 if key != "onComplete.push" {
113 t.Errorf("expected key='onComplete.push', got '%s'", key)
114 }
115 if !val {
116 t.Error("expected val=true after toggle")
117 }
118
119 // Toggle back
120 key, val = s.ToggleBool()
121 if val {
122 t.Error("expected val=false after second toggle")
123 }
124 _ = key
125}
126
127func TestSettingsOverlay_ToggleBool_OnStringItem(t *testing.T) {
128 s := NewSettingsOverlay()

Callers

nothing calls this directly

Calls 4

LoadFromConfigMethod · 0.95
MoveDownMethod · 0.95
ToggleBoolMethod · 0.95
NewSettingsOverlayFunction · 0.85

Tested by

no test coverage detected