feat: add realtime challenge client and local smoke test
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user