Close DV-01–04,07,09,13,14: unify operator-deck UX in server/web.
Standardize neon cyan on #00e8f5, wire SacredPageHeader across Builds/Path Tracer/LOTL, dedupe Pages.css, align Path Tracer chrome, drop dead wealth-deck CSS, add prefers-color-scheme shell + HelpTip, sidebar version from package.json build inject, and Vitest CSS regression guards.
This commit is contained in:
@@ -64,6 +64,36 @@ func TestGetAgentNotFound(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestUpsertAgentPreservesOperatorNameWhenDiffersFromHostname(t *testing.T) {
|
||||
d := openTestDB(t)
|
||||
a := &models.Agent{
|
||||
ID: "renamed-worker",
|
||||
Name: "Living Room PC",
|
||||
Hostname: "DESKTOP-ABC123",
|
||||
Status: "offline",
|
||||
LastSeen: time.Now(),
|
||||
}
|
||||
if err := d.UpsertAgent(a); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
// Reconnect reports hostname only — UpsertAgent must keep operator label.
|
||||
a.Name = "DESKTOP-ABC123"
|
||||
a.Hostname = "DESKTOP-ABC123"
|
||||
a.Status = "online"
|
||||
if err := d.UpsertAgent(a); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
got, err := d.GetAgent(a.ID)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if got.Name != "Living Room PC" {
|
||||
t.Fatalf("operator name should be preserved; got %q hostname=%q", got.Name, got.Hostname)
|
||||
}
|
||||
}
|
||||
|
||||
func TestUpsertAgentPreservesCreatedAt(t *testing.T) {
|
||||
d := openTestDB(t)
|
||||
a := seedAgent(t, d, "persist-created")
|
||||
|
||||
Reference in New Issue
Block a user