Add HTML5 authoring rollback detail
This commit is contained in:
@@ -179,6 +179,7 @@ def test_html5_server_rendered_project_editor(tmp_path: Path):
|
||||
assert authoring.status_code == 200
|
||||
assert "text/html" in authoring.headers["content-type"]
|
||||
assert "data-html5-authoring-changes" in authoring.text
|
||||
assert "data-html5-authoring-detail" in authoring.text
|
||||
assert "Изменений пока нет" in authoring.text
|
||||
assert "<html" not in authoring.text
|
||||
|
||||
@@ -2336,6 +2337,15 @@ def test_authoring_context_and_completion_preview(tmp_path: Path):
|
||||
assert changes.json()[0]["added_lines"] == 3
|
||||
assert changes.json()[0]["production_applied"] is False
|
||||
|
||||
html5_changes = client.get(f"/html5/projects/{project_id}/authoring/changes")
|
||||
assert html5_changes.status_code == 200
|
||||
assert "text/html" in html5_changes.headers["content-type"]
|
||||
assert "data-html5-authoring-changes" in html5_changes.text
|
||||
assert "data-html5-authoring-detail" in html5_changes.text
|
||||
assert 'hx-target="[data-html5-authoring-detail]"' in html5_changes.text
|
||||
assert apply_payload["change_id"] in html5_changes.text
|
||||
assert "<html" not in html5_changes.text
|
||||
|
||||
rollback = client.get(
|
||||
f"/projects/{project_id}/authoring/changes/{apply_payload['change_id']}/rollback-preview"
|
||||
)
|
||||
@@ -2346,6 +2356,16 @@ def test_authoring_context_and_completion_preview(tmp_path: Path):
|
||||
assert any(line["kind"] == "REMOVE" for line in rollback_payload["semantic_diff"])
|
||||
assert any(check["name"] == "apply" and check["status"] == "READY" for check in rollback_payload["checks"])
|
||||
|
||||
html5_detail = client.get(f"/html5/projects/{project_id}/authoring/changes/{apply_payload['change_id']}")
|
||||
assert html5_detail.status_code == 200
|
||||
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 "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
|
||||
|
||||
rollback_apply = client.post(
|
||||
f"/projects/{project_id}/authoring/changes/{apply_payload['change_id']}/apply-rollback",
|
||||
json={
|
||||
|
||||
Reference in New Issue
Block a user