feat: add realtime challenge client and local smoke test
CI / test (pull_request) Successful in 2m53s
PR合并自动部署 / release-check (pull_request) Successful in 1m34s
PR合并自动部署 / deploy (pull_request) Successful in 12s

This commit is contained in:
2026-08-09 03:08:01 +08:00
parent 821311f4ad
commit 1dd828609e
9 changed files with 872 additions and 7 deletions
+15
View File
@@ -55,3 +55,18 @@ def test_toolbox_and_games_资源入口与移动端触控样式存在():
assert ".calculator-controls [hidden]" in styles
assert ".sudoku-board" in styles
assert "@media (max-width: 700px)" in styles
def test_realtime_match_联机码与_websocket_前端资源存在():
template = (settings.BASE_DIR / "templates" / "index.html").read_text(encoding="utf-8")
realtime = (STATIC_ROOT / "js" / "realtime.js").read_text(encoding="utf-8")
styles = (STATIC_ROOT / "css" / "app.css").read_text(encoding="utf-8")
assert 'id="challenge-create"' in template
assert 'id="challenge-join-form"' in template
assert template.count("js/realtime.js") == 1
assert "new WebSocket" in realtime
assert "setInterval(refreshMatch, 2000)" in realtime
assert "Idempotency-Key" in realtime
assert ".challenge-panel" in styles
assert ".realtime-progress-panel" in styles