Rewrite frontend site identity, version stamp, and Excel export.
Changelog remains the source of APP_VERSION via overlay sync-version.mjs.
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
"""Native frontend site/version/export modules live under periscope/src."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from pathlib import Path
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
SRC = ROOT / "periscope" / "src" / "frontend"
|
||||
|
||||
|
||||
def test_site_version_export_are_src():
|
||||
for rel in (
|
||||
"src/lib/site.ts",
|
||||
"src/lib/version.ts",
|
||||
"src/lib/report-export.ts",
|
||||
"scripts/sync-version.mjs",
|
||||
):
|
||||
path = SRC / rel
|
||||
assert path.is_file(), rel
|
||||
assert "Native Periscope overlay" not in path.read_text(encoding="utf-8")[:400]
|
||||
|
||||
|
||||
def test_site_exports():
|
||||
text = (SRC / "src/lib/site.ts").read_text(encoding="utf-8")
|
||||
for name in (
|
||||
"SITE_URL",
|
||||
"SITE_NAME",
|
||||
"SITE_DESCRIPTION",
|
||||
"SITE_TAGLINE",
|
||||
"OPERATOR_NAME",
|
||||
"CONTACT_EMAIL",
|
||||
"TWITTER_HANDLE",
|
||||
"pageMetadata",
|
||||
):
|
||||
assert name in text
|
||||
|
||||
|
||||
def test_report_export_entry():
|
||||
text = (SRC / "src/lib/report-export.ts").read_text(encoding="utf-8")
|
||||
assert "export function exportReportToExcel" in text
|
||||
assert "Findings" in text
|
||||
|
||||
|
||||
def test_version_constants():
|
||||
text = (SRC / "src/lib/version.ts").read_text(encoding="utf-8")
|
||||
assert "export const APP_VERSION" in text
|
||||
assert "export const APP_VERSION_DATE" in text
|
||||
Reference in New Issue
Block a user