Add htmx HTML5 fragments
CI / python (push) Has been cancelled
CI / rust (push) Has been cancelled

This commit is contained in:
2026-05-16 21:18:43 +03:00
parent 567b517699
commit 03f1af0301
3 changed files with 92 additions and 18 deletions
+20
View File
@@ -107,6 +107,10 @@ def test_html5_server_rendered_project_editor(tmp_path: Path):
assert 'data-html5-page="editor"' in editor.text
assert "data-html5-editor" in editor.text
assert "data-html5-symbol-results" in editor.text
assert 'hx-get="/html5/projects/' in editor.text
assert 'hx-target="[data-html5-symbol-results]"' in editor.text
assert 'hx-target="[data-html5-source]"' in editor.text
assert 'hx-swap="outerHTML"' in editor.text
assert "hx-ext=\"sse\"" in editor.text
assert f"sse-connect=\"/html5/projects/{project_id}/events\"" in editor.text
assert "htmx.org" in editor.text
@@ -121,6 +125,22 @@ def test_html5_server_rendered_project_editor(tmp_path: Path):
assert "data:" in first_chunk
assert project_id in first_chunk
symbols = client.get(f"/html5/projects/{project_id}/symbols", params={"q": "Проверить"})
assert symbols.status_code == 200
assert "text/html" in symbols.headers["content-type"]
assert 'data-html5-symbol' in symbols.text
assert "Проверить" in symbols.text
assert "<html" not in symbols.text
snapshot = client.get(f"/projects/{project_id}/snapshot/export").json()
module_node = next(node for node in snapshot["nodes"] if node["kind"] == "MODULE")
source = client.get(f"/html5/projects/{project_id}/source/{module_node['lineage_id']}")
assert source.status_code == 200
assert "text/html" in source.headers["content-type"]
assert "data-html5-source" in source.text
assert "Проверить" in source.text
assert "<html" not in source.text
def test_project_setup_mock_import_indexes_project():
client = TestClient(app)