test: initialize terminal in fuzzy skill setting test
- commit
- f60e492e551892e737d24a7eaf7730f1f60b75af
- author
- patriceckhart · · 2026-09-10 06:18 UTC
- parent
- 71725d9
- signature
- unsigned
- refs
- tag: v0.3.72
1 file · +4 -2
M packages/agent/modes/fuzzy_skill_suggest_test.go +4 -2
| @@ -114,14 +114,16 @@ func (s *fuzzySkillSettingsStore) SetFuzzySkillSuggest(value bool) error { | |||
| 114 | 114 | } | |
| 115 | 115 | ||
| 116 | 116 | func TestFuzzySkillSetting(t *testing.T) { | |
| 117 | + | // Exercise the normal repaint path, independent of the developer's terminal. | |
| 118 | + | t.Setenv("TERM_PROGRAM", "") | |
| 117 | 119 | for _, enabled := range []bool{false, true} { | |
| 118 | - | i := NewInteractive(InteractiveConfig{FuzzySkillSuggest: &enabled}) | |
| 120 | + | i := NewInteractive(InteractiveConfig{Terminal: &cleanupTestTerminal{}, FuzzySkillSuggest: &enabled}) | |
| 119 | 121 | if i.suggest.fuzzySkills != enabled { | |
| 120 | 122 | t.Fatal("startup preference ignored") | |
| 121 | 123 | } | |
| 122 | 124 | } | |
| 123 | 125 | store := &fuzzySkillSettingsStore{} | |
| 124 | - | i := NewInteractive(InteractiveConfig{SettingsStore: store}) | |
| 126 | + | i := NewInteractive(InteractiveConfig{Terminal: &cleanupTestTerminal{}, SettingsStore: store}) | |
| 125 | 127 | if i.suggest.fuzzySkills { | |
| 126 | 128 | t.Fatal("default must be off") | |
| 127 | 129 | } | |
| @@ -114,14 +114,16 @@ func (s *fuzzySkillSettingsStore) SetFuzzySkillSuggest(value bool) error { | |||||
| 114 | } | 114 | } | ||
| 115 | 115 | ||||
| 116 | func TestFuzzySkillSetting(t *testing.T) { | 116 | func TestFuzzySkillSetting(t *testing.T) { | ||
| 117 | + | // Exercise the normal repaint path, independent of the developer's terminal. | |||
| 118 | + | t.Setenv("TERM_PROGRAM", "") | |||
| 117 | for _, enabled := range []bool{false, true} { | 119 | for _, enabled := range []bool{false, true} { | ||
| 118 | - | i := NewInteractive(InteractiveConfig{FuzzySkillSuggest: &enabled}) | 120 | + | i := NewInteractive(InteractiveConfig{Terminal: &cleanupTestTerminal{}, FuzzySkillSuggest: &enabled}) |
| 119 | if i.suggest.fuzzySkills != enabled { | 121 | if i.suggest.fuzzySkills != enabled { | ||
| 120 | t.Fatal("startup preference ignored") | 122 | t.Fatal("startup preference ignored") | ||
| 121 | } | 123 | } | ||
| 122 | } | 124 | } | ||
| 123 | store := &fuzzySkillSettingsStore{} | 125 | store := &fuzzySkillSettingsStore{} | ||
| 124 | - | i := NewInteractive(InteractiveConfig{SettingsStore: store}) | 126 | + | i := NewInteractive(InteractiveConfig{Terminal: &cleanupTestTerminal{}, SettingsStore: store}) |
| 125 | if i.suggest.fuzzySkills { | 127 | if i.suggest.fuzzySkills { | ||
| 126 | t.Fatal("default must be off") | 128 | t.Fatal("default must be off") | ||
| 127 | } | 129 | } | ||