integratedhub/tests/e2e/financial-ui.spec.ts
open-swe-dev-andrinoid[bot] b0e2ee60ce Apply patch [skip ci]
2026-01-21 14:42:55 +00:00

39 lines
1.3 KiB
TypeScript

import { expect, test, type Page } from "@playwright/test";
import { applyDeterministicPage, useE2EUser } from "./helpers.ts";
test("tenant payment history surfaces late fees", async ({ page }: { page: Page }) => {
await applyDeterministicPage(page);
await useE2EUser(page, "tenant");
await page.goto("/tenant/payments");
await expect(
page.getByRole("heading", { name: /payment history/i }),
).toBeVisible();
const pendingRow = page.locator("tbody tr", { hasText: "pending" }).first();
await expect(pendingRow).toContainText("$50");
await expect(page.getByText(/late fees due/i)).toBeVisible();
});
test("landlord rent collection highlights overdue payments", async ({ page }: { page: Page }) => {
await applyDeterministicPage(page);
await useE2EUser(page, "landlord");
await page.goto("/landlord/payments");
await expect(
page.getByRole("heading", { name: /rent collection/i }),
).toBeVisible();
const expectedCard = page.locator("div", { hasText: "Expected This Month" })
.first();
const overdueCard = page.locator("div", { hasText: "Overdue Payments" })
.first();
const lateFeeCard = page.locator("div", { hasText: "Late Fees Due" }).first();
await expect(expectedCard).toContainText("$1,800");
await expect(overdueCard).toContainText("1");
await expect(lateFeeCard).toContainText("$50");
});