import { expect, test } from "./utils/test"; import { getTenantCredentials, loginAsTenantUser } from "./utils/auth"; import { skipIfUnavailable } from "./utils/navigation"; import { skipOrFailWhenE2eInputsMissing } from "./utils/readiness"; /** * Files-Smoke (AK-P4a / DoD D.19): Login -> /files oeffnen -> Browser sichtbar. * * Die Route ist modul-gegated (tenantHasModule "files") + permission-gegated * (files.read_own). Bei aktivem Modul + Berechtigung rendert sie den Browser mit * `data-ui-id="ui.files.browser"`. Skippt ohne E2E-Credentials / wenn die Route * im Environment nicht erreichbar ist (404 bei fehlendem Modul/Recht). */ const credentials = getTenantCredentials(); const dashboardPath = process.env.E2E_TENANT_DASHBOARD_PATH ?? "/app/dashboard"; const filesPath = process.env.E2E_TENANT_FILES_PATH ?? dashboardPath.replace(/\/dashboard\/?$/u, "/files"); test.describe("files smoke", () => { test("renders the files browser", async ({ page }) => { skipOrFailWhenE2eInputsMissing(["E2E_TENANT_EMAIL", "E2E_TENANT_PASSWORD"], "Files smoke inputs not configured"); await loginAsTenantUser(page, credentials!); const response = await page.goto(filesPath, { waitUntil: "domcontentloaded" }); await skipIfUnavailable(page, response, "Files path is not reachable in this environment"); await expect(page.locator('[data-ui-id="ui.files.browser"]')).toBeVisible(); }); });