27 lines
1.1 KiB
TypeScript
27 lines
1.1 KiB
TypeScript
import { expect, test } from "./utils/test";
|
|
import { getTenantCredentials, loginAsTenantUser } from "./utils/auth";
|
|
import { skipOrFailWhenE2eInputsMissing } from "./utils/readiness";
|
|
|
|
// D-D0a — Smoke: Login -> /select-tenant -> Profil-Karte sichtbar -> Karte klicken -> Tenant-Space.
|
|
const credentials = getTenantCredentials();
|
|
|
|
test.describe("select-tenant (Login Tenantauswahl)", () => {
|
|
test("renders the profile picker and enters a tenant on card click", async ({ page }) => {
|
|
if (!credentials) {
|
|
skipOrFailWhenE2eInputsMissing(["E2E_TENANT_EMAIL", "E2E_TENANT_PASSWORD"], "Skipping select-tenant smoke flow");
|
|
}
|
|
|
|
await loginAsTenantUser(page, credentials!);
|
|
|
|
await page.goto("/select-tenant", { waitUntil: "domcontentloaded" });
|
|
await expect(page.locator('[data-ui-id="ui.auth.selectTenant.page"]')).toBeVisible();
|
|
|
|
const firstCard = page.locator('[data-ui-id="ui.auth.selectTenant.card"]').first();
|
|
await expect(firstCard).toBeVisible();
|
|
await firstCard.click();
|
|
|
|
// Erfolgreiche Auswahl leitet in den Tenant-Space (…/dashboard).
|
|
await expect(page).toHaveURL(/\/dashboard(?:[?#].*)?$/u);
|
|
});
|
|
});
|