31 lines
1.5 KiB
TypeScript
31 lines
1.5 KiB
TypeScript
import { expect, test } from "./utils/test";
|
|
import { getTenantCredentials, loginAsTenantUser } from "./utils/auth";
|
|
import { skipIfUnavailable } from "./utils/navigation";
|
|
import { skipOrFailWhenE2eInputsMissing } from "./utils/readiness";
|
|
|
|
/**
|
|
* Calendar smoke (AK-P16a / DoD D.19): Login -> /calendar oeffnen -> Ansicht
|
|
* sichtbar.
|
|
*
|
|
* Die Route ist modul-gegated (tenantHasModule "integrations" — Kalender ist eine
|
|
* Apps-Engine-Integration) + permission-gegated (calendar.connect_own). Bei aktivem
|
|
* Modul + Berechtigung rendert sie die Kalender-Ansicht mit
|
|
* `data-ui-id="ui.calendar.list"`. 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 calendarPath = process.env.E2E_TENANT_CALENDAR_PATH ?? dashboardPath.replace(/\/dashboard\/?$/u, "/calendar");
|
|
|
|
test.describe("calendar smoke", () => {
|
|
test("renders the calendar view", async ({ page }) => {
|
|
skipOrFailWhenE2eInputsMissing(["E2E_TENANT_EMAIL", "E2E_TENANT_PASSWORD"], "Calendar smoke inputs not configured");
|
|
await loginAsTenantUser(page, credentials!);
|
|
|
|
const response = await page.goto(calendarPath, { waitUntil: "domcontentloaded" });
|
|
await skipIfUnavailable(page, response, "Calendar path is not reachable in this environment");
|
|
|
|
await expect(page.locator('[data-ui-id="ui.calendar.list"]')).toBeVisible();
|
|
});
|
|
});
|