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