R-522: a disconnected tunnel is told on the dashboard row
Since v0.292.0 (R-841) cloudflared's health check asks /ready, so a lost connection reads unhealthy; the cloudflared row now also carries the tag "Kivulrol nem erheto el" with a plain title, in hu+en. New parity case dashboard_tunnel_offline (born as a key). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0159rPz1ZhFKsS53msqPYxtS
This commit is contained in:
@@ -101,3 +101,30 @@ func TestInfraMetaFor_RegularAppIsNil(t *testing.T) {
|
||||
t.Error("filebrowser must be the Linked infra stack")
|
||||
}
|
||||
}
|
||||
|
||||
// R-522: a disconnected tunnel (cloudflared's /ready health check failing → State unhealthy) is told
|
||||
// on the dashboard row as „Kívülről nem érhető el", not left at a state the household reads as fine;
|
||||
// a connected tunnel and an unhealthy OTHER infra stack carry no such tag.
|
||||
func TestR522_TunnelOfflineTagOnlyForUnhealthyCloudflared(t *testing.T) {
|
||||
data := infraPageData("dashboard")
|
||||
html := renderBackupPage(t, "dashboard", data)
|
||||
if strings.Contains(html, `data-tunnel-offline="true"`) {
|
||||
t.Fatal("a connected tunnel must not carry the offline tag")
|
||||
}
|
||||
set := infraStacksTestSet()
|
||||
set[0].State = stacks.StateUnhealthy // cloudflared
|
||||
data["Stacks"] = set
|
||||
html = renderBackupPage(t, "dashboard", data)
|
||||
if !strings.Contains(html, `data-tunnel-offline="true"`) || !strings.Contains(html, "rhet") {
|
||||
t.Fatal("an unhealthy cloudflared must carry the offline tag with its sentence")
|
||||
}
|
||||
if !strings.Contains(html, "Kívülről nem érhető el") {
|
||||
t.Error("the tag text must be the Hungarian sentence")
|
||||
}
|
||||
set = infraStacksTestSet()
|
||||
set[1].State = stacks.StateUnhealthy // traefik
|
||||
data["Stacks"] = set
|
||||
if strings.Contains(renderBackupPage(t, "dashboard", data), `data-tunnel-offline="true"`) {
|
||||
t.Error("only cloudflared's state means the tunnel is down")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user