diff --git a/backend/tests/test_cloud.py b/backend/tests/test_cloud.py index 41780e6..c54bebd 100644 --- a/backend/tests/test_cloud.py +++ b/backend/tests/test_cloud.py @@ -310,6 +310,32 @@ async def test_webdav_connect_validates(async_client, db_session, monkeypatch): assert resp.status_code == 422 +async def test_list_connections_reads_display_name_override_column( + async_client, db_session, cloud_connection_factory +): + """GET /api/cloud/connections must succeed after migration 0006. + + Regression for Phase 12 UAT blocker: psycopg.errors.UndefinedColumn was raised + because cloud_connections.display_name_override did not exist in the live schema. + This test proves the ORM can read all Phase 12 columns without schema errors. + """ + auth = await _create_user_and_token(db_session, role="user") + await cloud_connection_factory(db_session, auth["user"].id, provider="nextcloud") + + resp = await async_client.get( + "/api/cloud/connections", + headers=auth["headers"], + ) + + assert resp.status_code == 200, f"Unexpected status: {resp.status_code} — {resp.text}" + data = resp.json() + assert isinstance(data.get("items"), list) + assert len(data["items"]) == 1 + conn = data["items"][0] + assert conn["provider"] == "nextcloud" + assert "credentials_enc" not in conn + + # ── CLOUD-02: Credential encryption round-trip ──────────────────────────────── async def test_credentials_enc_not_exposed(