Files
Tomas Dvorak b17a06fbba 🚀 Dash - Homelab Dashboard
A clean, customizable homelab dashboard inspired by CasaOS.

Features:
- Empty-first dashboard (no demo data)
- 3 themes: Light, Dark, CasaOS glassmorphism
- Widgets: Clock (multi-timezone), Pi-hole, Memos, Immich, Image
- Drag & drop app organization
- Grid + list view for apps
- Groups with collapse/expand
- Proper widget refresh handling
- Visual timezone picker
- Square app cards with hover effects

Stack: Go + Gin + PostgreSQL + Next.js 15 + React 19 + Tailwind CSS + shadcn/ui
2026-05-03 16:13:46 +02:00

36 lines
805 B
Go

package validation
import "testing"
func TestAbsoluteHTTP(t *testing.T) {
tests := []struct {
name string
raw string
wantErr bool
}{
{"http", "http://localhost:3000", false},
{"https", "https://example.com", false},
{"relative", "/pihole", true},
{"ftp", "ftp://example.com", true},
{"missing host", "https://", true},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
_, err := AbsoluteHTTP(tt.raw, "url")
if (err != nil) != tt.wantErr {
t.Fatalf("AbsoluteHTTP() error = %v, wantErr %v", err, tt.wantErr)
}
})
}
}
func TestName(t *testing.T) {
if got, err := Name(" Pi-hole "); err != nil || got != "Pi-hole" {
t.Fatalf("Name() = %q, %v", got, err)
}
if _, err := Name(""); err == nil {
t.Fatal("Name() accepted empty value")
}
}