test(studio): remove duplicated shell logic

parent bc926849
...@@ -68,21 +68,16 @@ def test_dashboard_studio_nav_entry_is_present_for_user_session_shell(): ...@@ -68,21 +68,16 @@ def test_dashboard_studio_nav_entry_is_present_for_user_session_shell():
assert 'data-studio-shell="dashboard"' in response.text assert 'data-studio-shell="dashboard"' in response.text
def test_dashboard_studio_preserves_empty_diagnostics_copy_before_targets_load(): def test_dashboard_studio_renders_empty_diagnostics_contract_for_shell_boot():
diagnostics_text = "No diagnostics yet." client = TestClient(app)
_login_as_admin(client)
rendered = _render_studio_bootstrap({})
assert rendered["dataset_state"] == "empty"
assert rendered["text"] == diagnostics_text
response = client.get("/dashboard/studio")
def _render_studio_bootstrap(payload: dict) -> dict: assert response.status_code == 200
diagnostics_text = "No diagnostics yet." assert 'id="studio-diagnostics" data-empty-message="No diagnostics yet."' in response.text
targets = payload.get("targets") if isinstance(payload, dict) else None assert '<span data-i18n="studio.diagnostics_empty">No diagnostics yet.</span>' in response.text
if isinstance(targets, list) and targets: assert '<script id="studio-bootstrap" type="application/json">{}</script>' in response.text
return {"dataset_state": "ready", "text": "Studio bootstrap payload loaded."}
return {"dataset_state": "empty", "text": diagnostics_text}
def _find_session_secret() -> str: def _find_session_secret() -> str:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment