Route /dashboard to sales UI
This commit is contained in:
+3
-1
@@ -300,7 +300,9 @@ def operator_ui() -> FileResponse:
|
||||
@app.get("/dashboard")
|
||||
def dashboard_ui() -> FileResponse:
|
||||
# Backward-compatible entrypoint used in production bookmarks.
|
||||
return operator_ui()
|
||||
# Route dashboard directly to the sales cockpit so users can continue
|
||||
# their sales funnel workflow from legacy /dashboard links.
|
||||
return sales_ui()
|
||||
|
||||
|
||||
@app.get("/supervisor")
|
||||
|
||||
@@ -476,6 +476,16 @@ def test_admin_ui_route_exists():
|
||||
assert "admin/assets/app.js" in response.text
|
||||
|
||||
|
||||
def test_dashboard_route_points_to_sales_ui():
|
||||
client = TestClient(app)
|
||||
response = client.get("/dashboard")
|
||||
assert response.status_code == 200
|
||||
assert "КонтурCC Продажи" not in response.text
|
||||
assert "KonturCC Продажи" in response.text
|
||||
assert "sales/assets/app.js" in response.text
|
||||
assert 'id="salesDashboard"' in response.text
|
||||
|
||||
|
||||
def test_supervisor_ui_uses_realtime_and_kpi_endpoints():
|
||||
app_js = (Path(__file__).resolve().parents[1] / "ui" / "supervisor" / "app.js").read_text(encoding="utf-8")
|
||||
index_html = (Path(__file__).resolve().parents[1] / "ui" / "supervisor" / "index.html").read_text(encoding="utf-8")
|
||||
|
||||
Reference in New Issue
Block a user