feat(theming): add catppuccin, dracula, nord, tokyonight themes
This commit is contained in:
@@ -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")
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user