File size: 966 Bytes
cd0ff97
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
186f4a4
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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