From 4c23ae5107690a77a4253eaecbb7dfa822bdffc3 Mon Sep 17 00:00:00 2001 From: Lukasz Kasprzak Date: Fri, 24 Jul 2026 13:16:57 +0200 Subject: web reader: fix chapter arrows (drive chap select) + mono (move #pane out of controls form) --- internal/web/server_test.go | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) (limited to 'internal/web/server_test.go') diff --git a/internal/web/server_test.go b/internal/web/server_test.go index 77dfe74..638eb2b 100644 --- a/internal/web/server_test.go +++ b/internal/web/server_test.go @@ -406,3 +406,37 @@ func TestChooseListener(t *testing.T) { } }) } + +// TestReaderPaneOutsideForm guards the mono fix: #pane must render AFTER the +// controls so its reading text inherits body's --font-reading (which +// the mono toggle flips) instead of the form's --font-ui. +func TestReaderPaneOutsideForm(t *testing.T) { + srv := NewServer(config.Default()) + rec := httptest.NewRecorder() + srv.ServeHTTP(rec, httptest.NewRequest("GET", "/reader", nil)) + b := rec.Body.String() + f := strings.Index(b, "") + p := strings.Index(b, `id="pane"`) + if f < 0 || p < 0 || p < f { + t.Errorf("#pane must render after (form@%d pane@%d)", f, p) + } +} + +// TestReaderArrowsDriveChapSelect guards the chapter-nav fix: the arrows drive +// the chap ") + } + if strings.Contains(b, `hx-vals='{"chap"`) { + t.Errorf("chapter arrows must not use a competing hx-vals chap param") + } + if !strings.Contains(b, "Luke 12") { + t.Errorf("server did not render the requested Luke 12") + } +} -- cgit v1.3