Add HTML5 symbol detail fragment
This commit is contained in:
@@ -107,12 +107,14 @@ 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 "data-html5-symbol-detail" 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
|
||||
assert f'hx-get="/html5/projects/{project_id}/review"' 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-symbol-detail]"' 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
|
||||
@@ -133,11 +135,14 @@ def test_html5_server_rendered_project_editor(tmp_path: Path):
|
||||
assert symbols.status_code == 200
|
||||
assert "text/html" in symbols.headers["content-type"]
|
||||
assert 'data-html5-symbol' in symbols.text
|
||||
assert 'data-html5-lineage-id' in symbols.text
|
||||
assert 'hx-target="[data-html5-symbol-detail]"' 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")
|
||||
procedure_node = next(node for node in snapshot["nodes"] if node["kind"] == "PROCEDURE")
|
||||
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"]
|
||||
@@ -145,6 +150,13 @@ def test_html5_server_rendered_project_editor(tmp_path: Path):
|
||||
assert "Проверить" in source.text
|
||||
assert "<html" not in source.text
|
||||
|
||||
detail = client.get(f"/html5/projects/{project_id}/symbols/{procedure_node['lineage_id']}/detail")
|
||||
assert detail.status_code == 200
|
||||
assert "text/html" in detail.headers["content-type"]
|
||||
assert "data-html5-symbol-detail" in detail.text
|
||||
assert "Проверить" in detail.text
|
||||
assert "<html" not in detail.text
|
||||
|
||||
report = client.get(f"/html5/projects/{project_id}/report")
|
||||
assert report.status_code == 200
|
||||
assert "text/html" in report.headers["content-type"]
|
||||
|
||||
Reference in New Issue
Block a user