增加风控列表总数并优化站内提醒

This commit is contained in:
zhangshy
2026-09-13 23:51:45 +08:00
parent 38fe6f3689
commit 2a3146e050
11 changed files with 160 additions and 24 deletions
+26
View File
@@ -196,6 +196,9 @@ def test_risk_workspace_has_context_sessions_system_tips_and_expandable_evidence
assert "data-clear-chat-context" in html
assert "data-alert-prompts" in html
assert "data-system-tips" in html
assert "data-system-tip-count" in html
assert "data-open-notification-records" in html
assert "站内提醒" in html
assert "data-policy-tips" in html
assert "data-report-preview" in html
assert "chatContextKey" in source
@@ -203,6 +206,9 @@ def test_risk_workspace_has_context_sessions_system_tips_and_expandable_evidence
assert "session_id: crypto.randomUUID()" not in source
assert "bindExpandableRows" in source
assert "bindAlertContext" in source
assert "isStationNotification" in source
assert "fetchStationNotifications" in source
assert "refreshSystemTipCount" in source
assert "actionDialog.close();" in source
assert "alertDialog.close();" in source
assert "reportDialog.close();" in source
@@ -246,6 +252,26 @@ def test_risk_alert_action_is_first_column() -> None:
assert "actionFirst: true" in source
def test_risk_tables_show_page_and_total_summary() -> None:
html = (PORTAL / "employee-risk" / "dashboard" / "index.html").read_text(encoding="utf-8")
source = (PORTAL / "employee-risk" / "dashboard" / "dashboard.js").read_text(encoding="utf-8")
for summary_id in ("alert", "evidence", "notification"):
assert f"data-{summary_id}-summary" in html
assert "page_size" in source
assert "totalPages" in source
assert "共 ${total} 条" in source
def test_risk_alert_prompts_hide_until_alert_context_is_bound() -> None:
html = (PORTAL / "employee-risk" / "dashboard" / "index.html").read_text(encoding="utf-8")
css = (PORTAL / "employee-risk" / "dashboard" / "dashboard.css").read_text(encoding="utf-8")
source = (PORTAL / "employee-risk" / "dashboard" / "dashboard.js").read_text(encoding="utf-8")
assert 'data-alert-prompts hidden' in html
assert ".risk-prompts[hidden]" in css
assert "display: none !important" in css
assert "document.querySelector('[data-alert-prompts]').hidden = !alertNo" in source
def test_admin_workspace_is_not_an_identity_placeholder() -> None:
html = (PORTAL / "employee-console" / "workspace" / "index.html").read_text(encoding="utf-8")
assert "只展示服务端确认的身份边界" not in html
+1 -1
View File
@@ -355,7 +355,7 @@ def test_list_endpoints_follow_the_documented_envelope(monkeypatch) -> None:
assert isinstance(body["data"], list), "data 必须是纯数组"
assert "items" not in body["data"] if isinstance(body["data"], dict) else True
assert set(body["meta"]) == {"trace_id", "next_cursor", "has_more"}
assert set(body["meta"]) == {"trace_id", "next_cursor", "has_more", "total", "page_size"}
assert set(body) == {"data", "meta"}, "不得增加其他顶层字段"