package main import ( "encoding/json" "net/http" "net/http/httptest" "slices" "strconv" "strings" "testing" "time" ) // The page's handler answers GET and nothing else; its manifest declares the port for this machine only and requires a route // (ADR 0616 ยง4, AC P2). func TestThePageAnswersGetOnlyAndTheManifestKeepsItToThisMachine(t *testing.T) { w := newOverviewWorld(t) w.entries = []*Entry{recordEntry(301, StatusAccepted, "2026-11-02", w.now.Add(-24*time.Hour), nil)} w.o.Start() h := PageHandler(w.o) rec := httptest.NewRecorder() h.ServeHTTP(rec, httptest.NewRequest(http.MethodGet, "/", nil)) body := rec.Body.String() if rec.Code != 200 || !strings.Contains(body, "Design 47, milestone 1") || !strings.Contains(body, "ADR 0301") || !strings.Contains(body, "Approve ADR 0301") || strings.Contains(body, "Delivery") { // no delivery block (design 47 H, H-A-125) t.Fatalf("%d\n%.600s", rec.Code, body) } if strings.Contains(body, "