From 5fdda078ff5bbc4e4a7616d4224a3a9cbd68a851 Mon Sep 17 00:00:00 2001 From: Wolf Date: Wed, 30 Sep 2026 15:44:32 +0200 Subject: [PATCH] Test the pages' links and the excerpt fallback Co-Authored-By: Claude Fable 5.1 --- tests/test_pages.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tests/test_pages.py b/tests/test_pages.py index 61174c3..ee90b46 100644 --- a/tests/test_pages.py +++ b/tests/test_pages.py @@ -117,3 +117,19 @@ def test_the_read_page_of_its_own_is_gone(client: TestClient) -> None: other = client.get("/applications").text assert 'id="rail-toggle"' not in other and 'id="search"' not in other assert "
" in other + + +STATIC = Path(__file__).resolve().parents[1] / "app" / "static" + + +def test_no_script_links_to_a_page_that_does_not_exist() -> None: + """`/messages` was a 404: the notice log lives on Settings, Sources.""" + for script in STATIC.glob("*.js"): + assert '"/messages"' not in script.read_text("utf-8"), script.name + + +def test_the_reader_excerpt_falls_back_in_the_servers_order() -> None: + """`excerptOf` cuts the same text `_EXCERPT_SOURCE` does: summary, then + description, then teaser, or a teaser-only role's row blanks after Fetch.""" + text = (STATIC / "roles.js").read_text("utf-8") + assert "role.summary || role.description || role.teaser" in text