diff --git a/tests/test_frontend_audit_fixes.py b/tests/test_frontend_audit_fixes.py index 7e81313..29841bf 100644 --- a/tests/test_frontend_audit_fixes.py +++ b/tests/test_frontend_audit_fixes.py @@ -87,8 +87,8 @@ def test_error_role_persisted(tmp_path): def test_chat_state_js_route(client): - """/chat_state.js 静态路由返回 JS(前端模块可加载,§4.5)。""" - r = client.get("/chat_state.js") + """/static/chat_state.js 静态资源可加载(前端模块,§4.5;现统一挂载 /static)。""" + r = client.get("/static/chat_state.js") assert r.status_code == 200 - assert "application/javascript" in r.headers["content-type"] + assert "javascript" in r.headers["content-type"] assert "GenesisState" in r.text or "autoBindProject" in r.text diff --git a/tests/test_progress_e2e.py b/tests/test_progress_e2e.py index 068e301..2c57be1 100644 --- a/tests/test_progress_e2e.py +++ b/tests/test_progress_e2e.py @@ -54,10 +54,10 @@ def test_ws_progress_second_emit_after_disconnect(tmp_path): def test_static_chat_ws_served(tmp_path): - # 覆盖 app.py 中 /chat_ws.js 与 /chat_state.js 端点 + # 覆盖 /static 下 chat_ws.js / chat_state.js 静态资源(现统一挂载 /static) client = _client(tmp_path) - assert client.get("/chat_ws.js").status_code == 200 - assert client.get("/chat_state.js").status_code == 200 + assert client.get("/static/chat_ws.js").status_code == 200 + assert client.get("/static/chat_state.js").status_code == 200 def test_projects_endpoints_noop(tmp_path):