import { expect, test } from "@playwright/test"; test.describe("Guest Home", () => { test("renders the current guest landing UI", async ({ page }) => { await page.goto("/"); await expect( page.getByRole("heading", { name: /trusted tools for property operations and personal budgeting/i, }), ).toBeVisible(); await expect( page.getByRole("button", { name: "Sign In or Create Account" }), ).toBeVisible(); await expect(page.getByRole("button", { name: "Start as Landlord" })) .toBeVisible(); await expect(page.getByRole("button", { name: "Start as Tenant" })) .toBeVisible(); }); test("role quick-start stores landlord intent before auth", async ({ page }) => { await page.route("**/auth/login**", async (route) => { await route.fulfill({ status: 200, contentType: "text/html", body: "Mock Login", }); }); await page.goto("/"); await page.getByRole("button", { name: "Start as Landlord" }).click(); await expect(page).toHaveURL(/\/auth\/login/); const loginPurpose = await page.evaluate(() => globalThis.localStorage.getItem("login-purpose") ); expect(loginPurpose).toBe("landlord"); }); });