fix(theming): restore gruvbox as default via Default() helper

This commit is contained in:
MDietermann
2026-04-14 13:42:58 +02:00
parent 4f7411ca95
commit 698271a235
6 changed files with 28 additions and 14 deletions

View File

@@ -160,7 +160,7 @@ func TestPlanAfterApplyIsEmpty(t *testing.T) {
}
}
func TestUnknownThemeFallsBackToFirst(t *testing.T) {
func TestUnknownThemeFallsBackToDefault(t *testing.T) {
home := t.TempDir()
t.Setenv("HOME", home)
r := &fakeRunner{installed: map[string]bool{"neovim": true}}
@@ -171,9 +171,8 @@ func TestUnknownThemeFallsBackToFirst(t *testing.T) {
t.Fatal(err)
}
chadrc, _ := os.ReadFile(filepath.Join(home, ".config", "nvim", "lua", "chadrc.lua"))
// Unknown theme IDs fall back to the first entry of theming.List(),
// which is sorted alphabetically by ID (currently "catppuccin").
if !strings.Contains(string(chadrc), `theme = "catppuccin"`) {
// Unknown theme IDs fall back to theming.Default(), which is gruvbox.
if !strings.Contains(string(chadrc), `theme = "gruvbox"`) {
t.Fatalf("fallback theme not applied: %s", chadrc)
}
}