fix(ux): tolerate legacy template encoding
Some checks failed
CD Pipeline / deploy (push) Has been cancelled
Some checks failed
CD Pipeline / deploy (push) Has been cancelled
This commit is contained in:
@@ -394,6 +394,29 @@ def test_sitewide_ui_ux_repair_package_prioritizes_controlled_template_repairs()
|
||||
assert package["repair_items"][0]["controlled_actions"]
|
||||
|
||||
|
||||
def test_sitewide_ui_ux_agent_reports_non_utf8_templates(tmp_path):
|
||||
from services.ai_surface_html_readback_service import (
|
||||
build_sitewide_ui_ux_agent_inventory,
|
||||
build_sitewide_ui_ux_repair_package,
|
||||
)
|
||||
|
||||
template_dir = tmp_path / "templates"
|
||||
template_dir.mkdir()
|
||||
(template_dir / "legacy_dashboard.html").write_bytes(b"\xa3 legacy dashboard")
|
||||
|
||||
inventory = build_sitewide_ui_ux_agent_inventory(root=tmp_path)
|
||||
issue = inventory["issue_surfaces"][0]
|
||||
package = build_sitewide_ui_ux_repair_package(source_inventory=inventory)
|
||||
|
||||
assert inventory["status"] == "warning"
|
||||
assert issue["status"] == "critical"
|
||||
assert issue["findings"][0]["type"] == "template_encoding_error"
|
||||
assert package["repair_items"][0]["controlled_actions"][0]["action"] == (
|
||||
"normalize_template_encoding_utf8"
|
||||
)
|
||||
assert package["safety"]["writes_database"] is False
|
||||
|
||||
|
||||
def test_surface_html_readback_check_is_part_of_ai_smoke(monkeypatch):
|
||||
from services import ai_automation_smoke_service as smoke
|
||||
|
||||
|
||||
Reference in New Issue
Block a user