integratedhub/tests/e2e/landlord-onboarding.spec.ts
open-swe-dev-andrinoid[bot] c773372c30 Apply patch [skip ci]
2026-01-21 14:44:06 +00:00

52 lines
2.2 KiB
TypeScript

import { expect, Page, test } from "@playwright/test";
import { applyDeterministicPage, useE2EUser } from "./helpers.ts";
test("landlord profile setup advances to property details", async ({ page }: { page: Page }) => {
await applyDeterministicPage(page);
await useE2EUser(page, "landlord-onboarding");
await page.goto("/landlord/onboarding/profile");
await page.getByLabel(/full name/i).fill("Jordan Landlord");
await page.getByLabel(/email address/i).fill("jordan.landlord@example.com");
await page.getByLabel(/phone number/i).fill("555-0222");
await page.getByLabel(/^street address/i).fill("901 Aurora Ave");
await page.getByLabel(/apartment, suite/i).fill("Suite 5");
await page.getByLabel(/^city/i).fill("Seattle");
await page.getByLabel(/^state/i).fill("WA");
await page.getByLabel(/zip/i).fill("98104");
await page.getByLabel(/^country/i).selectOption("US");
await page.getByRole("button", { name: /continue|next|save/i }).click();
await expect(page).toHaveURL(/\/landlord\/onboarding\/property-setup/);
await expect(
page.getByRole("heading", { name: /add your first rental property/i }),
).toBeVisible();
});
test("property setup submits and lands on landlord dashboard", async ({ page }: { page: Page }) => {
await applyDeterministicPage(page);
await useE2EUser(page, "landlord-onboarding");
await page.goto("/landlord/onboarding/property-setup");
await page.getByLabel(/^street address/i).fill("701 Pine St");
await page.getByLabel(/city/i).fill("Seattle");
await page.getByLabel(/^state/i).fill("WA");
await page.getByLabel(/zip/i).fill("98101");
await page.getByLabel(/country/i).selectOption("US");
await page.getByLabel(/property type/i).selectOption("apartment");
await page.getByLabel(/bedrooms/i).selectOption("2");
await page.getByLabel(/bathrooms/i).selectOption("2");
await page.getByLabel(/monthly rent/i).fill("2600");
await page.getByLabel(/security deposit/i).fill("2600");
await page.getByRole("button", { name: /complete onboarding|finish|submit/i })
.click();
await expect(page).toHaveURL(/\/landlord\/dashboard/);
await expect(page.getByRole("heading", { name: /landlord dashboard/i }))
.toBeVisible();
});