fix(ux): ignore hidden template metadata
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:
@@ -369,6 +369,7 @@ def test_sitewide_ui_ux_agent_inventory_scans_real_pages():
|
||||
issue_templates = {item["template"] for item in inventory["issue_surfaces"]}
|
||||
assert "templates/base.html" not in templates
|
||||
assert not any("/components/" in item for item in templates)
|
||||
assert not any("/." in item or item.startswith("templates/.") for item in templates)
|
||||
assert "templates/ai_history.html" not in issue_templates
|
||||
assert "templates/ai_recommend.html" not in issue_templates
|
||||
|
||||
@@ -405,6 +406,7 @@ def test_sitewide_ui_ux_agent_reports_non_utf8_templates(tmp_path):
|
||||
routes_dir = tmp_path / "routes"
|
||||
routes_dir.mkdir()
|
||||
(template_dir / "legacy_dashboard.html").write_bytes(b"\xa3 legacy dashboard")
|
||||
(template_dir / "._legacy_dashboard.html").write_bytes(b"\xa3 apple metadata")
|
||||
(routes_dir / "legacy_routes.py").write_bytes(b"\xa3 legacy route source")
|
||||
|
||||
inventory = build_sitewide_ui_ux_agent_inventory(root=tmp_path)
|
||||
@@ -412,6 +414,7 @@ def test_sitewide_ui_ux_agent_reports_non_utf8_templates(tmp_path):
|
||||
package = build_sitewide_ui_ux_repair_package(source_inventory=inventory)
|
||||
|
||||
assert inventory["status"] == "warning"
|
||||
assert inventory["summary"]["template_count"] == 1
|
||||
assert issue["status"] == "critical"
|
||||
assert issue["findings"][0]["type"] == "template_encoding_error"
|
||||
assert package["repair_items"][0]["controlled_actions"][0]["action"] == (
|
||||
|
||||
Reference in New Issue
Block a user