Scriptorium / tests /test_frontend_export_controls.py
mattkevan's picture
Fix exporter
186f4a4
Raw
History Blame Contribute Delete
966 Bytes
from pathlib import Path
def test_export_screen_wires_track_and_transport_actions() -> None:
source = Path("frontend/app.js").read_text(encoding="utf-8")
assert 'data-action="playRenderedChapter"' in source
assert 'data-action="exportJumpToTrack"' in source
assert 'data-action="exportSeek"' in source
assert "playRenderedChapter(target)" in source
assert "exportJumpToTrack(target)" in source
assert "exportSeek(target)" in source
def test_export_screen_uses_downloadable_export_links() -> None:
source = Path("frontend/app.js").read_text(encoding="utf-8")
assert "downloadCurrentExport()" in source
assert 'download="${escapeAttr(exportFilename())}"' in source
def test_export_screen_prepares_attachment_downloads() -> None:
source = Path("frontend/app.js").read_text(encoding="utf-8")
assert "await requestExport({ autoDownload: true });" in source
assert 'searchParams.set("download", "1")' in source