Rebrands the product from MobilityOps to Fleet Ops across the UI, backend defaults and knowledge base, and makes nl-BE/en-GB/fr-BE full first-class languages: i18next with eager-bundled per-namespace resources, a persisted accessible language switcher (topbar and mobile drawer), locale-aware date/number formatting, and a coverage test that fails the build on any missing or empty translation key. Backend dynamic content (demo scenarios, blocked-reason text, integration status) moves from fixed English/Dutch prose to stable message codes + params so the frontend can localize it; the demo knowledge base gains a fully translated NL/EN/FR procedure corpus (11 documents each) with per-language retrieval and localized evidence-state messages. The Demo Guide becomes breakpoint-adaptive: a docked rail on extra-wide desktop, a floating panel that auto-collapses to a persistent, closable progress chip on standard desktop/tablet, and a collapsed/half/full bottom sheet on mobile -- with scroll+focus+ highlight on "go to this step", Escape handling, and reduced-motion support. The Data Quality Workbench gets accessible choice-card decisions with a clear primary/ secondary/tertiary action hierarchy; the Automation ledger groups repeated successes and uses meaningful short refs; the Audit trail groups events by correlation id with human action labels and readable before/after diffs. Attention Queue, Today's movements, Vehicles, Bookings and Data Quality rows are fully clickable (stretched-link pattern) with independent secondary links, keyboard support and mobile touch targets. Fixes a topbar overflow on mobile caused by the new language switcher (moved into the mobile drawer at <=960px) and two dangling aria-labelledby references introduced this session. Updates all affected Playwright specs for the new nl-BE default and the new Audit/DemoGuide DOM structure, and adds new i18n-coverage, demo-guide-adaptive and clickable-rows specs. 131 backend tests, Ruff and mypy, and 71 Playwright tests pass. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
55 lines
1.9 KiB
Python
55 lines
1.9 KiB
Python
from app.core.db import SessionLocal
|
|
from app.seed_loader import reset_and_seed
|
|
|
|
|
|
def test_demo_manifest_is_public(client):
|
|
# No login call at all -- the demo-entry screen and badge need this before any
|
|
# session exists.
|
|
response = client.get("/api/v1/demo/manifest")
|
|
assert response.status_code == 200
|
|
|
|
|
|
def test_demo_manifest_shape(client):
|
|
body = client.get("/api/v1/demo/manifest").json()
|
|
assert body["organization_name"] == "Northstar Mobility"
|
|
assert body["demo_mode"] is True
|
|
assert body["synthetic_data"] is True
|
|
assert body["allow_reset"] is True
|
|
assert body["timezone"] == "Europe/Brussels"
|
|
assert body["guide_available"] is True
|
|
assert set(body["required_roles"]) == {"operations_manager", "rental_employee"}
|
|
assert body["last_reset_at"] is not None
|
|
assert body["anchor_date"] is not None
|
|
|
|
scenario_ids = {s["id"] for s in body["scenarios"]}
|
|
assert scenario_ids == {
|
|
"return-anomaly",
|
|
"duplicate-customer",
|
|
"booking-overlap",
|
|
"automation-retry",
|
|
"knowledge-question",
|
|
}
|
|
integration_keys = {i["key"] for i in body["integrations"]}
|
|
assert integration_keys == {"n8n", "ragcore", "mcp_hub"}
|
|
|
|
|
|
def test_demo_manifest_scenarios_ready_after_fresh_reset(client):
|
|
db = SessionLocal()
|
|
try:
|
|
reset_and_seed(db)
|
|
finally:
|
|
db.close()
|
|
|
|
body = client.get("/api/v1/demo/manifest").json()
|
|
scenarios = {s["id"]: s for s in body["scenarios"]}
|
|
for scenario_id, scenario in scenarios.items():
|
|
assert scenario["ready"] is True, f"{scenario_id} should be ready right after a reset"
|
|
assert scenario["blocked_reason_code"] is None
|
|
assert scenario["start_path"]
|
|
|
|
|
|
def test_demo_manifest_ragcore_labelled_as_demo_mode_not_live(client):
|
|
body = client.get("/api/v1/demo/manifest").json()
|
|
ragcore = next(i for i in body["integrations"] if i["key"] == "ragcore")
|
|
assert ragcore["status_code"] == "demoMode"
|