oficina / calendar Public

Answer the review (Claude Fable 5.1)

- A test pins the layout's Onest link to estilo's versioned prefix (not
  needed where an equivalent already exists).
- Slides: the credits page test expects Onest; a committed .pyc removed
  and __pycache__/ ignored. Calendar, Memoria: "'s" in writetheme's
  comment. Fichas: estilo is a direct requirement (go mod tidy).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Paul Campbell pushed by paul@keymail.dev 9e10f98084b3e230c7f16eb9a8534b929416ac94 parent 8f2fe47
2 files changed, +25 −1
  • internal/calendartest/fontlink_test.go +24 −0
  • scripts/writetheme/main.go +1 −1

CI passed — run details

CI log
=== vet ===
go vet ./...
=== fmt ===
=== test ===
go test ./...
?   	amadan.net/oficina/calendar/cmd/calendar	[no test files]
ok  	amadan.net/oficina/calendar/internal/calendar	4.474s
?   	amadan.net/oficina/calendar/internal/calendar/icons	[no test files]
?   	amadan.net/oficina/calendar/internal/calendar/seal	[no test files]
ok  	amadan.net/oficina/calendar/internal/calendartest	2.108s
ok  	amadan.net/oficina/calendar/internal/guardstest	0.050s
?   	amadan.net/oficina/calendar/scripts/writetheme	[no test files]
=== migration-check ===
go run github.com/carlosframework/rastrillo/cmd/rastrillo migration check
rastrillo migration check: models and migrations agree
diff --git a/internal/calendartest/fontlink_test.go b/internal/calendartest/fontlink_test.go
new file mode 100644
index 0000000..32496b1
--- /dev/null
+++ b/internal/calendartest/fontlink_test.go
@@ -0,0 +1,24 @@
+package calendartest
+
+import (
+ "bytes"
+ "os"
+ "path/filepath"
+ "testing"
+
+ "amadan.net/oficina/estilo.git/theme"
+)
+
+// The layout names Onest's stylesheet by a literal path; this keeps that
+// literal equal to estilo's versioned prefix, so an estilo font move
+// fails here rather than every page quietly falling back to the system
+// face.
+func TestLayoutLinksEstilosFonts(t *testing.T) {
+ layout, err := os.ReadFile(filepath.Join("..", "calendar", "templates", "layout.html"))
+ if err != nil {
+ t.Fatal(err)
+ }
+ if want := `href="` + theme.FontPrefix + `fonts.css"`; !bytes.Contains(layout, []byte(want)) {
+ t.Errorf("layout.html does not link %s", want)
+ }
+}
diff --git a/scripts/writetheme/main.go b/scripts/writetheme/main.go
index 25ebbed..33591f9 100644
--- a/scripts/writetheme/main.go
+++ b/scripts/writetheme/main.go
@@ -1,5 +1,5 @@
// Command writetheme re-writes internal/calendar/static/theme.css from the
-// estilo this module pins: Calma, with Calendar' accent. Run it from the
+// estilo this module pins: Calma, with Calendar's accent. Run it from the
// repository root after upgrading estilo; TestThemeIsEstilosForCalendar
// fails until you do.
package main