Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions static/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -3133,6 +3133,9 @@ ${details}
return;
}

// 手动入口只会调用本加载函数,因此有候选时必须同步显示治理操作区。
showInvalidTokenDetectionSummary(count, invalidTokenGovernanceCandidates);

// 渲染候选列表
const listEl = document.getElementById('invalidTokenCandidateList');
const listWrap = document.getElementById('invalidTokenCandidateListWrap');
Expand Down
24 changes: 24 additions & 0 deletions tests/test_invalid_token_governance_frontend_contract.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
"""失效 Token 治理手动入口的前端回归测试。"""

import unittest
from pathlib import Path


class InvalidTokenGovernanceFrontendContractTests(unittest.TestCase):
def test_manual_governance_loader_reveals_action_summary(self):
"""手动加载到候选后必须显示包含治理按钮的摘要区。"""
repo_root = Path(__file__).resolve().parents[1]
main_js = (repo_root / "static" / "js" / "main.js").read_text(encoding="utf-8")
loader_start = main_js.index("async function loadInvalidTokenGovernanceCandidates")
loader_end = main_js.index("/** 批量将失效 Token 候选账号置为停用 */", loader_start)
loader_source = main_js[loader_start:loader_end]

self.assertIn(
"showInvalidTokenDetectionSummary(count, invalidTokenGovernanceCandidates);",
loader_source,
"手动失效治理入口加载到候选后没有显示治理操作区",
)


if __name__ == "__main__":
unittest.main()