-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcustom_test.go
More file actions
41 lines (36 loc) · 986 Bytes
/
Copy pathcustom_test.go
File metadata and controls
41 lines (36 loc) · 986 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
package widgets
import (
"testing"
"github.com/yuys13/agystatusline/types"
)
func TestWidgetInterfaces(t *testing.T) {
RegisterAll()
ctx := types.RenderContext{
Data: types.StatusJSON{},
}
item := types.WidgetItem{
Type: "model",
}
widgetsList := []string{
"model", "git-branch", "git-changes", "quota", "custom-text",
"sandbox", "agent-state", "context-bar", "quota-bar", "artifacts",
"subagents", "tasks",
}
for _, name := range widgetsList {
t.Run(name, func(t *testing.T) {
w := GetWidget(name)
if w == nil {
t.Fatalf("Widget %q not registered", name)
}
if nameStr := w.GetDisplayName(); nameStr == "" {
t.Errorf("GetDisplayName() returned empty for %q", name)
}
if defaultColor := w.GetDefaultColor(); defaultColor == "" {
t.Errorf("GetDefaultColor() returned empty for %q", name)
}
if bodyColor := w.GetBodyColor(item, ctx); bodyColor == "" {
t.Errorf("GetBodyColor() returned empty for %q", name)
}
})
}
}