From 3d3ad4ba90c4d7dea4730ef129f8c9e065f05d6e Mon Sep 17 00:00:00 2001 From: Lukasz Kasprzak Date: Mon, 3 Aug 2026 23:40:30 +0200 Subject: liturgy: carry the observed rank on DayInfo --- internal/readings/partids_test.go | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 internal/readings/partids_test.go (limited to 'internal/readings/partids_test.go') diff --git a/internal/readings/partids_test.go b/internal/readings/partids_test.go new file mode 100644 index 0000000..68f5ec0 --- /dev/null +++ b/internal/readings/partids_test.go @@ -0,0 +1,30 @@ +package readings + +import ( + "testing" + + "github.com/lukaszkasprzak/lectio/internal/config" +) + +// The day header must carry the rank, not just name and colour: the app's +// calendar rows and the CLI's day line both display it. +func TestDayInfoCarriesRank(t *testing.T) { + cases := []struct { + date, lect, wantRank string + }{ + // 2026-08-01 is the memorial of St Alphonsus Liguori in the OF. + {"2026-08-01", "new", "memorial"}, + // 2026-12-25 is a solemnity. + {"2026-12-25", "new", "solemnity"}, + } + for _, c := range cases { + cfg := config.Config{UILanguage: "en", Lectionary: c.lect, All: true} + _, info, err := Load(cfg, Options{Date: c.date, All: true}) + if err != nil { + t.Fatalf("%s: load: %v", c.date, err) + } + if info.Rank != c.wantRank { + t.Errorf("%s: rank = %q, want %q", c.date, info.Rank, c.wantRank) + } + } +} -- cgit v1.3