Add HTML5 authoring completion preview
This commit is contained in:
@@ -112,6 +112,9 @@ def test_html5_server_rendered_project_editor(tmp_path: Path):
|
||||
assert f'hx-get="/html5/projects/{project_id}/report"' in editor.text
|
||||
assert "data-html5-review" in editor.text
|
||||
assert f'hx-get="/html5/projects/{project_id}/review"' in editor.text
|
||||
assert "data-html5-authoring-preview" in editor.text
|
||||
assert "data-html5-authoring-preview-form" in editor.text
|
||||
assert f'hx-post="/html5/projects/{project_id}/authoring/completion-preview"' in editor.text
|
||||
assert "data-html5-authoring-changes" in editor.text
|
||||
assert f'hx-get="/html5/projects/{project_id}/authoring/changes"' in editor.text
|
||||
assert 'hx-get="/html5/projects/' in editor.text
|
||||
@@ -2275,6 +2278,24 @@ def test_authoring_context_and_completion_preview(tmp_path: Path):
|
||||
assert any(check["name"] == "apply" and check["status"] == "BLOCKED" for check in preview_payload["checks"])
|
||||
assert preview_payload["semantic_diff"][0]["kind"] == "ADD"
|
||||
|
||||
html5_preview = client.post(
|
||||
f"/html5/projects/{project_id}/authoring/completion-preview",
|
||||
data={
|
||||
"object_name": "Документ.ЗаказПокупателя",
|
||||
"routine_name": "Проведение",
|
||||
"cursor_line": "3",
|
||||
"source_text": source_text,
|
||||
"intent": "fill-check",
|
||||
},
|
||||
)
|
||||
assert html5_preview.status_code == 200
|
||||
assert "text/html" in html5_preview.headers["content-type"]
|
||||
assert "data-html5-authoring-preview-result" in html5_preview.text
|
||||
assert "ЗначениеЗаполнено(Контрагент)" in html5_preview.text
|
||||
assert "BLOCKED" in html5_preview.text
|
||||
assert "ADD" in html5_preview.text
|
||||
assert "<html" not in html5_preview.text
|
||||
|
||||
diff_preview = client.post(
|
||||
f"/projects/{project_id}/authoring/semantic-diff-preview",
|
||||
json={
|
||||
|
||||
Reference in New Issue
Block a user