+
UTF-8 · 0 bytes
@@ -273,4 +282,5 @@
{% endif %}
+{% include "_editor_assets.html" %}
{% endblock %}
diff --git a/l4d2web/tests/test_blueprints.py b/l4d2web/tests/test_blueprints.py
index cad2025..99c43ef 100644
--- a/l4d2web/tests/test_blueprints.py
+++ b/l4d2web/tests/test_blueprints.py
@@ -453,3 +453,19 @@ def test_blueprint_config_form_post_round_trip(user_client) -> None:
# line round-tripped into the rendered textarea.
for line in ("// pinned by form-contract test", "sv_cheats 0", "exec server.cfg"):
assert line in body, f"line not found in rendered page: {line!r}"
+
+
+def test_blueprint_get_includes_editor_markup(user_client) -> None:
+ """Blueprint detail page must carry the editor opt-in attribute and
+ the editor asset partial — the v2 CodeMirror 6 wiring contract."""
+ create = user_client.post(
+ "/blueprints",
+ data={"name": "editor-attrs", "arguments": "", "config": "", "overlay_ids": []},
+ headers={"X-CSRF-Token": "test-token"},
+ )
+ assert create.status_code == 302
+ page = user_client.get(create.headers["Location"])
+ body = page.get_data(as_text=True)
+ assert 'data-editor-language="srccfg"' in body
+ assert "vendor/editor.bundle.js" in body
+ assert "js/editor.js" in body
diff --git a/l4d2web/tests/test_script_overlay_routes.py b/l4d2web/tests/test_script_overlay_routes.py
index 91897e7..6e63ba7 100644
--- a/l4d2web/tests/test_script_overlay_routes.py
+++ b/l4d2web/tests/test_script_overlay_routes.py
@@ -277,3 +277,16 @@ def test_permissions_admin_can_edit_any(app, alice_id, admin_id) -> None:
with session_scope() as s:
overlay = s.query(Overlay).filter_by(id=overlay_id).one()
assert overlay.script == "echo admin"
+
+
+def test_script_overlay_detail_carries_editor_markup(app, alice_id) -> None:
+ """Script overlay detail page must carry the editor opt-in attribute
+ and the editor asset partial — the v2 CodeMirror 6 wiring contract."""
+ overlay_id = _create_script_overlay(app, alice_id)
+ client = _client_for(app, alice_id)
+ response = client.get(f"/overlays/{overlay_id}")
+ assert response.status_code == 200
+ body = response.get_data(as_text=True)
+ assert 'data-editor-language="bash"' in body
+ assert "vendor/editor.bundle.js" in body
+ assert "js/editor.js" in body