import type { Page } from "@playwright/test";
import { expect } from "@playwright/test";
import { E2E_DD_ADMIN } from "./lifecycle-api-stubs";

export async function loginAsDdAdmin(page: Page): Promise<void> {
    await page.goto("/admin-login");
    await page.locator("div.cursor-pointer").filter({ hasText: E2E_DD_ADMIN.email }).click();
    await expect(page).toHaveURL(/\/dashboard$/);
}
