summaryrefslogtreecommitdiff
path: root/internal/web/server_test.go
diff options
context:
space:
mode:
authorLukasz Kasprzak <lukas@labunix.xyz>2026-07-24 10:32:28 +0200
committerLukasz Kasprzak <lukas@labunix.xyz>2026-07-24 10:32:28 +0200
commitc9f3bf46f0de09edb796e35f3dcff349febf75c9 (patch)
treec1a0b98b484e4da557c1ab205dfff0d92ce8ac36 /internal/web/server_test.go
parenta865374755480a4aef2a6156afccdf08a91422ea (diff)
downloadlectio-c9f3bf46f0de09edb796e35f3dcff349febf75c9.tar.gz
lectio-c9f3bf46f0de09edb796e35f3dcff349febf75c9.zip
dayinfo: show feast/day name + colour (modern niedziela + traditional missalemeum) in cli/tui/web; v0.5.0
Diffstat (limited to 'internal/web/server_test.go')
-rw-r--r--internal/web/server_test.go9
1 files changed, 7 insertions, 2 deletions
diff --git a/internal/web/server_test.go b/internal/web/server_test.go
index 00da039..809ee59 100644
--- a/internal/web/server_test.go
+++ b/internal/web/server_test.go
@@ -50,6 +50,11 @@ func TestServer(t *testing.T) {
if !strings.Contains(body, `id="theme"`) {
t.Errorf("body missing theme <link>")
}
+ // Name is source-language (Polish), never translated, even
+ // though the surrounding chrome is English -- see RenderReadings.
+ if !strings.Contains(body, `class="dayinfo"`) || !strings.Contains(body, "Święto św. Marii Magdaleny") {
+ t.Errorf("body missing day-info header: %q", body)
+ }
})
t.Run("readings partial", func(t *testing.T) {
@@ -230,7 +235,7 @@ func TestServer(t *testing.T) {
// TestRenderOrErrorNoSectionsLang checks the "no readings at all for this
// day" fragment (finding §1) follows lang instead of always being Polish.
func TestRenderOrErrorNoSectionsLang(t *testing.T) {
- html := string(renderOrError(nil, nil, "new", "horizontal", "en", nil))
+ html := string(renderOrError(nil, nil, "new", "horizontal", "en", liturgy.DayInfo{}, nil))
if !strings.Contains(html, "no readings for this day") {
t.Errorf("en renderOrError(no secs) = %q, want it to contain %q", html, "no readings for this day")
}
@@ -238,7 +243,7 @@ func TestRenderOrErrorNoSectionsLang(t *testing.T) {
t.Errorf("en renderOrError(no secs) should not carry Polish wording: %q", html)
}
- html = string(renderOrError(nil, nil, "new", "horizontal", "pl", nil))
+ html = string(renderOrError(nil, nil, "new", "horizontal", "pl", liturgy.DayInfo{}, nil))
if !strings.Contains(html, "brak czytań na ten dzień") {
t.Errorf("pl renderOrError(no secs) = %q, want it to contain %q", html, "brak czytań na ten dzień")
}