Add HTML5 authoring change apply form
CI / python (push) Has been cancelled
CI / rust (push) Has been cancelled

This commit is contained in:
2026-05-16 23:50:03 +03:00
parent c14db34f14
commit 460881428b
3 changed files with 133 additions and 2 deletions
+25
View File
@@ -2316,12 +2316,37 @@ def test_authoring_context_and_completion_preview(tmp_path: Path):
assert html5_diff_preview.status_code == 200
assert "text/html" in html5_diff_preview.headers["content-type"]
assert "data-html5-authoring-diff-result" in html5_diff_preview.text
assert "data-html5-authoring-apply-form" in html5_diff_preview.text
assert f'hx-post="/html5/projects/{project_id}/authoring/apply-change-set"' in html5_diff_preview.text
assert "data-html5-authoring-apply-result" in html5_diff_preview.text
assert "Diff preview" in html5_diff_preview.text
assert "Если Отказ Тогда" in html5_diff_preview.text
assert "task-session" in html5_diff_preview.text
assert "BLOCKED" in html5_diff_preview.text
assert "<html" not in html5_diff_preview.text
html5_blocked_change_apply = client.post(
f"/html5/projects/{project_id}/authoring/apply-change-set",
data={
"routine_name": "Проведение",
"source_path": str(module),
"original_text": source_text,
"proposed_text": source_text.replace(
" Сумма = 0;",
" Сумма = 0;\n Если Отказ Тогда\n Возврат;\n КонецЕсли;",
),
"task_id": "task.authoring",
"session_id": "session.authoring",
"user_id": "dev.ivan",
"expected_next_version_id": "wrong-version",
},
)
assert html5_blocked_change_apply.status_code == 200
assert "text/html" in html5_blocked_change_apply.headers["content-type"]
assert "data-html5-authoring-apply-result" in html5_blocked_change_apply.text
assert "Expected version id does not match current preview" in html5_blocked_change_apply.text
assert "<html" not in html5_blocked_change_apply.text
diff_preview = client.post(
f"/projects/{project_id}/authoring/semantic-diff-preview",
json={