aboutsummaryrefslogtreecommitdiff
path: root/internal/tui/tui_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/tui/tui_test.go')
-rw-r--r--internal/tui/tui_test.go35
1 files changed, 35 insertions, 0 deletions
diff --git a/internal/tui/tui_test.go b/internal/tui/tui_test.go
index 85a8175..330259d 100644
--- a/internal/tui/tui_test.go
+++ b/internal/tui/tui_test.go
@@ -113,6 +113,41 @@ func TestBodyLinesLocalisesHeading(t *testing.T) {
}
}
+// TestDayInfoLineShown checks the day-info line (celebration Name, plus
+// its temporal Season if any) is rendered under the top header bar when
+// the loaded source carries one, and that pageSize grows its chrome
+// allowance to account for the extra line.
+func TestDayInfoLineShown(t *testing.T) {
+ m := Model{
+ cfg: config.Config{UILanguage: "en"},
+ date: "2026-07-22",
+ dayInfo: liturgy.DayInfo{Name: "St. Mary Magdalene", Season: "Feria IV after VIII Sunday after Pentecost"},
+ }
+ out := m.View()
+ if !strings.Contains(out, "St. Mary Magdalene") {
+ t.Errorf("View() missing day-info name: %q", out)
+ }
+ if !strings.Contains(out, "Feria IV after VIII Sunday after Pentecost") {
+ t.Errorf("View() missing day-info season: %q", out)
+ }
+ if got := m.headerLines(); got != 2 {
+ t.Errorf("headerLines() = %d, want 2 when DayInfo.Name is set", got)
+ }
+}
+
+// TestDayInfoLineOmittedWhenEmpty checks the header block stays a single
+// line (headerLines() == 1) when the source yielded no DayInfo -- e.g. a
+// harvested-sigla offline load, which carries citations only.
+func TestDayInfoLineOmittedWhenEmpty(t *testing.T) {
+ m := Model{cfg: config.Config{UILanguage: "en"}, date: "2026-07-22"}
+ if line := m.dayInfoLine(); line != "" {
+ t.Errorf("dayInfoLine() = %q, want empty when DayInfo is zero", line)
+ }
+ if got := m.headerLines(); got != 1 {
+ t.Errorf("headerLines() = %d, want 1 when DayInfo is zero", got)
+ }
+}
+
// TestFooterKeysLocalised checks the footer keybar text follows
// cfg.UILanguage.
func TestFooterKeysLocalised(t *testing.T) {