"""Legal shells and Open Graph images live under periscope/src.""" from __future__ import annotations from pathlib import Path ROOT = Path(__file__).resolve().parents[1] SRC = ROOT / "periscope" / "src" / "frontend" / "src" def _text(rel: str) -> str: path = SRC / rel assert path.is_file(), rel return path.read_text(encoding="utf-8") def test_legal_and_og_are_src(): for rel in ( "components/legal/legal-page.tsx", "components/legal/changelog-timeline.tsx", "components/legal/file-guide-page.tsx", "app/opengraph-image.tsx", "app/twitter-image.tsx", ): head = _text(rel)[:400] assert "Native Periscope overlay" not in head def test_legal_page_exports(): text = _text("components/legal/legal-page.tsx") assert "export function MarkdownContent" in text assert "export function LegalPageShell" in text assert "export function LegalPage" in text assert "OPERATOR_NAME" in text assert "PeriscopeMark" in text def test_changelog_timeline_parses_tagged_items(): text = _text("components/legal/changelog-timeline.tsx") assert "export function ChangelogTimeline" in text assert "function parseReleases" in text assert "New|Improved|Fixed" in text assert "What's new in Periscope." in text def test_file_guide_splits_on_eda_export_heading(): text = _text("components/legal/file-guide-page.tsx") assert "export function FileGuidePage" in text assert "## Exporting from your EDA tool" in text assert "function splitGuide" in text assert 'from "@/components/ui/tabs"' in text def test_opengraph_contract(): og = _text("app/opengraph-image.tsx") assert 'from "next/og"' in og assert "export const size = { width: 1200, height: 630 }" in og assert 'export const contentType = "image/png"' in og assert "SITE_URL" in og tw = _text("app/twitter-image.tsx") assert 'from "./opengraph-image"' in tw assert "export { default, alt, size, contentType }" in tw