Files
sshtermy/internal/ui/accent_test.go
T
Claude 67c88c3c25 Einheitliche Symbole, Terminal-Look und eigene Farben
- Menüs nutzen Text-Tags wie [+] [k] [/] aus reinem ASCII; im übrigen Text
  nur Zeichen, die Cascadia Mono (Windows Terminal) selbst hat. Vorher kamen
  ⚙ ⚿ ⌕ ⇅ ⚠ ✦ … aus Ersatzschriften und verschoben Breite und Rahmen.
  TestGlyphsInCascadia hält das fest.
- Schalter Einstellungen › Nerd-Font-Symbole: echte Bildsymbole für Nerd
  Fonts (z. B. Cascadia Mono NF), pro Rechner, kein Sync.
- Gerätesymbole im Manager als Prompt-Zeichen ($ Linux, % macOS, > Windows,
  # Switch, @ Router, ! Firewall).
- Terminal-Look: eckige Rahmen, Gruppen als // name, Palette mit $-Prompt,
  Logo >_ sshTermy.
- Neue Themes Matrix (grün), Bernstein (Retro), Neon (Cyber).
- Farben anpassen: Vorlage wählen, Farben per Farbton/Helligkeit/Hex ändern,
  Live-Vorschau, Kontrast-Check, Strg+S speichert (Theme eigene, mit Sync).

Idee: Dominik Bornhäußer

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018i4GUga3zgZAxFm2DLd5o2
2026-11-06 11:17:51 +00:00

72 lines
2.4 KiB
Go

package ui
import (
"testing"
"github.com/db9979/sshtermy/internal/domain"
)
func TestConnAccent(t *testing.T) {
cases := []struct {
c domain.Connection
want string
}{
{domain.Connection{Group: "Produktion / Web"}, "red"},
{domain.Connection{Tags: []string{"live"}}, "red"},
{domain.Connection{Alias: "web-staging"}, "green"},
{domain.Connection{Tags: []string{"dev"}}, "green"},
{domain.Connection{Group: "Labor"}, "blue"},
{domain.Connection{Alias: "nas"}, ""},
{domain.Connection{Alias: "nas", Color: "purple"}, "purple"},
{domain.Connection{Group: "prod", Color: accentNone}, ""},
}
for _, c := range cases {
if got := connAccent(c.c); got != c.want {
t.Errorf("%+v: %q, erwartet %q", c.c, got, c.want)
}
}
for _, d := range accentDefs {
if accentFromLabel(accentLabel(d.id)) != d.id {
t.Errorf("Rundreise %q kaputt", d.id)
}
if d.id != accentAuto && d.id != accentNone {
for _, th := range Themes {
if accentColor(th, d.id) == nil {
t.Errorf("%s: keine Farbe für %q", th.Name, d.id)
}
}
}
}
}
func TestDeviceClass(t *testing.T) {
p := func(sp domain.SystemProfile) domain.Connection { return domain.Connection{Profile: &sp} }
cases := []struct {
c domain.Connection
want devClass
}{
{domain.Connection{}, devUnknown},
{domain.Connection{Device: domain.DeviceNetwork}, devSwitch},
{p(domain.SystemProfile{Family: domain.FamilyLinux, OS: "Ubuntu 24.04"}), devLinux},
{p(domain.SystemProfile{Family: domain.FamilyWindows}), devWindows},
{p(domain.SystemProfile{Dialect: "powershell"}), devWindows},
{p(domain.SystemProfile{Dialect: "procurve", Model: "Aruba 2930F"}), devSwitch},
{p(domain.SystemProfile{Dialect: "cisco-ios", Model: "ISR4331"}), devSwitch}, // „ISR4331“ ist kein eigenes Wort „isr“
{p(domain.SystemProfile{Dialect: "cisco-ios", Model: "Cisco ISR 4331"}), devRouter},
{p(domain.SystemProfile{Dialect: "routeros"}), devRouter},
{p(domain.SystemProfile{Dialect: "fortios"}), devFirewall},
{p(domain.SystemProfile{Family: domain.FamilyBSD, OS: "pfSense 2.7"}), devFirewall},
{p(domain.SystemProfile{Family: domain.FamilyLinux, OS: "Kasachstan-Linux"}), devLinux},
}
for _, c := range cases {
if got := deviceClass(c.c); got != c.want {
t.Errorf("%+v: %q, erwartet %q", c.c.Profile, got, c.want)
}
}
for d := range devTags {
if devName(d) == "" {
t.Errorf("kein Name für %q", d)
}
}
}