fix(web): statusline tokens, unreachable dot, reachability test spans (#145)

Second review round (spec + standards):
- Polling-off and unreachable render as statusline tokens; the unreachable
  span drops mark-strong so the patina dot never sits next to red text.
- Reachability tests assert on the rendered span, which 'reachable' and
  'unreachable' substrings never could.
- A pass-log query failure now reads as reachable (no evidence rule) instead
  of condemning the browser, and admin.go loses its dead time import.
- startLatestPoller's doc no longer claims the admin page reads the poller;
  AGENTS.md carries the RefuseBackoff rename.
This commit is contained in:
2026-08-21 20:41:45 +07:00
parent fc8a40cfc6
commit d72c48295d
6 changed files with 14 additions and 11 deletions
+5 -5
View File
@@ -885,7 +885,7 @@ func TestAdminPageWithoutAPollerSaysSo(t *testing.T) {
cfg Config
want, unwant string
}{
{"polling switched off", testConfig(), "Polling is switched off", "not configured"},
{"polling switched off", testConfig(), `Polling: <span class="mark-faint">off</span>`, "not configured"},
{"browser not configured", lanesConfig(), "not configured", "Polling is switched off"},
} {
t.Run(tc.name, func(t *testing.T) {
@@ -986,7 +986,7 @@ func TestBrowserConfigAndReachabilityDerived(t *testing.T) {
router, st := newWebTestServer(t, lanesConfig())
seedPass(t, st, store.LanePass{Site: "kagane", RanAt: now.UnixMilli(), Skip: latest.SkipNoFetcher})
body := lanesBody(t, router, st)
if !strings.Contains(body, "not configured") || strings.Contains(body, "unreachable") {
if !strings.Contains(body, `mark-faint">not configured`) || strings.Contains(body, "unreachable") {
t.Errorf("unset BROWSER_WS_URL must read as not configured:\n%s", body)
}
})
@@ -997,7 +997,7 @@ func TestBrowserConfigAndReachabilityDerived(t *testing.T) {
router, st := newWebTestServer(t, cfg)
seedPass(t, st, store.LanePass{Site: "kagane", RanAt: now.Add(-time.Minute).UnixMilli(), Skip: latest.SkipSidecarDown})
body := lanesBody(t, router, st)
if !strings.Contains(body, "unreachable") {
if !strings.Contains(body, `bad">unreachable`) {
t.Errorf("recent sidecar-down passes must read as unreachable:\n%s", body)
}
})
@@ -1008,7 +1008,7 @@ func TestBrowserConfigAndReachabilityDerived(t *testing.T) {
router, st := newWebTestServer(t, cfg)
seedPass(t, st, store.LanePass{Site: "kagane", RanAt: now.Add(-time.Minute).UnixMilli(), Checked: 3})
body := lanesBody(t, router, st)
if !strings.Contains(body, "reachable") {
if !strings.Contains(body, `mark-strong">reachable`) {
t.Errorf("clean browser passes must read as reachable:\n%s", body)
}
})
@@ -1019,7 +1019,7 @@ func TestBrowserConfigAndReachabilityDerived(t *testing.T) {
router, st := newWebTestServer(t, cfg)
seedPass(t, st, store.LanePass{Site: "kagane", RanAt: now.Add(-30 * time.Minute).UnixMilli(), Skip: latest.SkipSidecarDown})
body := lanesBody(t, router, st)
if !strings.Contains(body, "reachable") {
if !strings.Contains(body, `mark-strong">reachable`) {
t.Errorf("a sidecar-down older than the backoff must read as reachable:\n%s", body)
}
})