Add HTML5 authoring rollback form

This commit is contained in:
2026-05-16 23:02:28 +03:00
parent d2c42cabda
commit a62e213b2f
3 changed files with 93 additions and 1 deletions
+16
View File
@@ -2361,11 +2361,27 @@ def test_authoring_context_and_completion_preview(tmp_path: Path):
assert "text/html" in html5_detail.headers["content-type"]
assert "data-html5-authoring-detail" in html5_detail.text
assert "Rollback preview" in html5_detail.text
assert "data-html5-authoring-rollback-form" in html5_detail.text
assert f'hx-post="/html5/projects/{project_id}/authoring/changes/{apply_payload["change_id"]}/apply-rollback"' in html5_detail.text
assert "data-html5-authoring-result" in html5_detail.text
assert "READY" in html5_detail.text
assert "REMOVE" in html5_detail.text
assert apply_payload["change_id"] in html5_detail.text
assert "<html" not in html5_detail.text
html5_blocked_apply = client.post(
f"/html5/projects/{project_id}/authoring/changes/{apply_payload['change_id']}/apply-rollback",
data={
"expected_rollback_version_id": rollback_payload["rollback_version_id"],
"approved_by": "dev.ivan",
},
)
assert html5_blocked_apply.status_code == 200
assert "text/html" in html5_blocked_apply.headers["content-type"]
assert "data-html5-authoring-result" in html5_blocked_apply.text
assert "Task id is required" in html5_blocked_apply.text
assert "<html" not in html5_blocked_apply.text
rollback_apply = client.post(
f"/projects/{project_id}/authoring/changes/{apply_payload['change_id']}/apply-rollback",
json={