Add HTML5 flowchart fragment
CI / python (push) Has been cancelled
CI / rust (push) Has been cancelled

This commit is contained in:
2026-05-17 00:36:43 +03:00
parent 7ee6deb088
commit 7583851dc4
3 changed files with 105 additions and 0 deletions
+34
View File
@@ -108,6 +108,8 @@ def test_html5_server_rendered_project_editor(tmp_path: Path):
assert "data-html5-editor" in editor.text
assert "data-html5-symbol-results" in editor.text
assert "data-html5-symbol-detail" in editor.text
assert "data-html5-flowchart" in editor.text
assert f'hx-get="/html5/projects/{project_id}/flowchart"' in editor.text
assert "data-html5-project-report" in editor.text
assert f'hx-get="/html5/projects/{project_id}/report"' in editor.text
assert "data-html5-review" in editor.text
@@ -335,6 +337,38 @@ def test_html5_object_context_fragment(tmp_path: Path):
assert "<html" not in context.text
def test_html5_flowchart_fragment(tmp_path: Path):
client = TestClient(app)
project_id = f"html5-flowchart-{uuid4()}"
(tmp_path / "module.bsl").write_text(
"""
Процедура ПровестиЗаказ()
ПроверитьОстатки();
Движения.ОстаткиТоваров.Записать();
КонецПроцедуры
Процедура ПроверитьОстатки()
КонецПроцедуры
""",
encoding="utf-8",
)
indexed = client.post("/projects/index", json={"path": str(tmp_path), "project_id": project_id})
assert indexed.status_code == 200
flowchart = client.get(
f"/html5/projects/{project_id}/flowchart",
params={"focus": "ПровестиЗаказ"},
)
assert flowchart.status_code == 200
assert "text/html" in flowchart.headers["content-type"]
assert "data-html5-flowchart" in flowchart.text
assert "Карта связей" in flowchart.text
assert "Nodes" in flowchart.text
assert "Edges" in flowchart.text
assert "ПровестиЗаказ" in flowchart.text or "ПроверитьОстатки" in flowchart.text
assert "<html" not in flowchart.text
def test_html5_project_setup_renders_server_fragments():
client = TestClient(app)
project_id = f"html5-setup-{uuid4()}"