refactor: compose export controller with explicit snapshots and task lifecycle
This commit is contained in:
@@ -156,6 +156,18 @@ def test_save_as_missing_image_keeps_original_context(editing, tmp_path):
|
||||
assert original.read_text() == "# Original"
|
||||
|
||||
|
||||
def test_export_snapshot_keeps_rendering_choices_after_ui_changes(editing, tmp_path):
|
||||
window, editor, path = editing
|
||||
window.theme = "dark"
|
||||
snapshot = window._export_snapshot()
|
||||
window.theme = "light"
|
||||
editor.replace_source_undoable("changed later")
|
||||
output = tmp_path / "snapshot.html"
|
||||
window.exports._export_web_to_path(output, "html", snapshot)
|
||||
html = output.read_text(encoding="utf-8")
|
||||
assert 'data-theme="dark"' in html and "changed later" not in html
|
||||
|
||||
|
||||
def test_save_as_copies_images_and_can_undo_rewritten_urls(editing, tmp_path):
|
||||
window, editor, original = editing
|
||||
source = store_image(original, b"image bytes")
|
||||
|
||||
Reference in New Issue
Block a user