summaryrefslogtreecommitdiffhomepage
path: root/packages/tui/internal/theme/loader_test.go
diff options
context:
space:
mode:
authoradamdottv <[email protected]>2025-06-26 14:54:32 -0500
committeradamdottv <[email protected]>2025-06-26 14:54:32 -0500
commit1b8cd796d661ecb748910c3d960ecaedd7c202a3 (patch)
tree5114d3647e95cdb8ba99bcd3d776f437b40368bd /packages/tui/internal/theme/loader_test.go
parent35fba793d057c23a856ebac6329ed4dcb6abe937 (diff)
downloadopencode-1b8cd796d661ecb748910c3d960ecaedd7c202a3.tar.gz
opencode-1b8cd796d661ecb748910c3d960ecaedd7c202a3.zip
feat(tui): more themes
Diffstat (limited to 'packages/tui/internal/theme/loader_test.go')
-rw-r--r--packages/tui/internal/theme/loader_test.go30
1 files changed, 18 insertions, 12 deletions
diff --git a/packages/tui/internal/theme/loader_test.go b/packages/tui/internal/theme/loader_test.go
index 1039ab3f1..37546789b 100644
--- a/packages/tui/internal/theme/loader_test.go
+++ b/packages/tui/internal/theme/loader_test.go
@@ -21,7 +21,7 @@ func TestLoadThemesFromJSON(t *testing.T) {
}
// Check for expected themes
- expectedThemes := []string{"tokyonight", "opencode", "everforest", "ayu", "example"}
+ expectedThemes := []string{"tokyonight", "opencode", "everforest", "ayu"}
for _, expected := range expectedThemes {
found := slices.Contains(themes, expected)
if !found {
@@ -43,22 +43,28 @@ func TestLoadThemesFromJSON(t *testing.T) {
}
func TestColorReferenceResolution(t *testing.T) {
- // Test the example theme which uses references
- example := GetTheme("example")
- if example == nil {
- t.Fatal("Failed to get example theme")
+ // Load themes first
+ err := LoadThemesFromJSON()
+ if err != nil {
+ t.Fatalf("Failed to load themes: %v", err)
+ }
+
+ // Test a theme that uses references (e.g., solarized uses color definitions)
+ solarized := GetTheme("solarized")
+ if solarized == nil {
+ t.Fatal("Failed to get solarized theme")
}
- // Check that brandBlue reference was resolved
- primary := example.Primary()
+ // Check that color references were resolved
+ primary := solarized.Primary()
if primary.Dark == nil || primary.Light == nil {
- t.Error("Primary color (brandBlue reference) not resolved")
+ t.Error("Primary color reference not resolved")
}
- // Check that nested reference (borderActive -> primary -> brandBlue) works
- borderActive := example.BorderActive()
- if borderActive.Dark == nil || borderActive.Light == nil {
- t.Error("BorderActive color (nested reference) not resolved")
+ // Check that all colors are properly resolved
+ text := solarized.Text()
+ if text.Dark == nil || text.Light == nil {
+ t.Error("Text color reference not resolved")
}
}