Test the pages' links and the excerpt fallback
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
1 parent
1074a2a0c9
commit
5fdda078ff
1 file changed
+16
@@ -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 "<main>" 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
|
||||
Reference in new issue
Block a user