diff options
| author | Lukasz Kasprzak <lukas@labunix.xyz> | 2026-07-24 12:48:05 +0200 |
|---|---|---|
| committer | Lukasz Kasprzak <lukas@labunix.xyz> | 2026-07-24 12:48:05 +0200 |
| commit | 55a5c793d04b55892fcddfc753d8526bd5748f03 (patch) | |
| tree | b045946a62a0b849b5c77a4100294d935ab741dd /internal/web/render_test.go | |
| parent | ed34fd574b4fc2e0a52c655ececddd1be29b271e (diff) | |
| download | lectio-55a5c793d04b55892fcddfc753d8526bd5748f03.tar.gz lectio-55a5c793d04b55892fcddfc753d8526bd5748f03.zip | |
web reader: /reader book picker + chapter nav + version compare, reusing pane templates; v0.9.0
Diffstat (limited to 'internal/web/render_test.go')
| -rw-r--r-- | internal/web/render_test.go | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/internal/web/render_test.go b/internal/web/render_test.go index de3c7c1..6002927 100644 --- a/internal/web/render_test.go +++ b/internal/web/render_test.go @@ -182,6 +182,29 @@ func TestRenderReadingsLocalizesEN(t *testing.T) { } } +func TestRenderPassageColumns(t *testing.T) { + html := string(RenderPassage("John", "John", 3, []string{"wuj"}, "vertical", "en")) + if !strings.Contains(html, "John 3") || !strings.Contains(html, "3:16") { + t.Errorf("passage columns missing heading/verse:\n%s", html) + } +} + +func TestRenderPassageInterlinear(t *testing.T) { + html := string(RenderPassage("John", "John", 3, []string{"wuj", "vul"}, "interlinear", "en")) + if !strings.Contains(html, "3:16") { + t.Errorf("interlinear missing verse:\n%s", html) + } +} + +func TestRenderPassageMissingVersion(t *testing.T) { + // A non-existent chapter yields no verses: the column must carry the + // "(not in wuj)" note, never a panic or an empty column. + html := string(RenderPassage("John", "John", 999, []string{"wuj"}, "vertical", "en")) + if !strings.Contains(html, "wuj") { + t.Errorf("missing-passage note absent:\n%s", html) + } +} + func TestUserTheme(t *testing.T) { dir := t.TempDir() t.Setenv("XDG_CONFIG_HOME", dir) |
