| 1 | """Tests for the site header brand mark.""" |
| 2 | |
| 3 | from __future__ import annotations |
| 4 | |
| 5 | from pathlib import Path |
| 6 | |
| 7 | REPO_ROOT = Path(__file__).resolve().parent.parent |
| 8 | |
| 9 | |
| 10 | def test_header_brand_uses_claracle_image_asset() -> None: |
| 11 | """Header brand mark must render the Claracle image through Hugo resources.""" |
| 12 | header = (REPO_ROOT / "layouts" / "partials" / "header.html").read_text(encoding="utf-8") |
| 13 | assert 'resources.Get "images/claracle.jpeg"' in header |
| 14 | assert '<img src="{{ .RelPermalink }}" width="32" height="32" alt="">' in header |
| 15 | assert ( |
| 16 | "<svg" not in header.split('<span class="site-brand__text">Claracle</span>', maxsplit=1)[0] |
| 17 | ) |
| 18 | |
| 19 | |
| 20 | def test_claracle_brand_image_exists() -> None: |
| 21 | """Brand image asset must exist at the path used by the header template.""" |
| 22 | assert (REPO_ROOT / "assets" / "images" / "claracle.jpeg").is_file() |