feat(theming): add catppuccin, dracula, nord, tokyonight themes

This commit is contained in:
MDietermann
2026-04-14 13:25:58 +02:00
parent 770bdcf3a2
commit 12c502d48a
21 changed files with 457 additions and 0 deletions

View File

@@ -148,3 +148,36 @@ func TestApplyNoChadrcIsFine(t *testing.T) {
t.Fatal(err)
}
}
func TestAllFiveThemesPresent(t *testing.T) {
want := []string{"catppuccin", "dracula", "gruvbox", "nord", "tokyonight"}
themes := List()
if len(themes) != len(want) {
t.Fatalf("want %d themes, got %d", len(want), len(themes))
}
for i, id := range want {
if themes[i].ID != id {
t.Fatalf("themes[%d].ID = %q, want %q", i, themes[i].ID, id)
}
}
}
func TestApplyEachThemeWritesStarship(t *testing.T) {
for _, id := range []string{"catppuccin", "dracula", "nord", "tokyonight"} {
id := id
t.Run(id, func(t *testing.T) {
home := t.TempDir()
t.Setenv("HOME", home)
if err := Apply(config.Config{}, id); err != nil {
t.Fatal(err)
}
data, err := os.ReadFile(filepath.Join(home, ".config", "starship.toml"))
if err != nil {
t.Fatal(err)
}
if len(data) == 0 {
t.Fatal("empty starship.toml")
}
})
}
}