fix(ux): ignore hidden template metadata
Some checks failed
CD Pipeline / deploy (push) Has been cancelled

This commit is contained in:
ogt
2026-07-03 00:46:29 +08:00
parent 04a251bf6d
commit 108ebf3f91
2 changed files with 4 additions and 0 deletions

View File

@@ -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"] == (