Add standalone export for Two Rivers at Moonrise
All checks were successful
Build Org Website / build (push) Successful in 44s

This commit is contained in:
gitea-actions
2026-07-30 23:37:18 +01:00
parent 563d4b63cc
commit 4659edc658
186 changed files with 4799 additions and 8 deletions

View File

@@ -288,4 +288,31 @@
(output "<html><body><div class=\"banner-header\">Site</div></body></html>"))
(should (string= output (z/render-rpg-standalone output 'html info)))))
;; ── standalone Two Rivers export ─────────────────────────────────────────────
(ert-deftest test/two-rivers-standalone-export-removes-normal-site-chrome ()
"The Two Rivers final-output filter should return a dedicated game document."
(let* ((info (list :input-file (site-path "play/two-rivers.org")))
(output (concat
"<html><head><script src=\"search.js\"></script></head><body>"
"<div class=\"banner-header\">Normal site</div>"
z/two-rivers-standalone-start
"<main data-two-rivers>Game</main>"
"<script type=\"module\" src=\"/assets/scripts/games/two-rivers/main.js\"></script>"
z/two-rivers-standalone-end
"<footer>Normal footer</footer></body></html>"))
(result (z/render-two-rivers-standalone output 'html info)))
(should (string-match-p "class=\"two-rivers-page\"" result))
(should (string-match-p "data-two-rivers" result))
(should (string-match-p "two-rivers/main.js" result))
(should-not (string-match-p "banner-header" result))
(should-not (string-match-p "Normal footer" result))
(should-not (string-match-p "search.js" result))))
(ert-deftest test/two-rivers-standalone-export-ignores-other-pages ()
"The Two Rivers filter must leave every other page unchanged."
(let* ((info (list :input-file (site-path "play/rpg.org")))
(output "<html><body><main>Existing RPG</main></body></html>"))
(should (string= output (z/render-two-rivers-standalone output 'html info)))))
;;; build-site-tests.el ends here