2026-08-11 15:20:31 -04:00
|
|
|
import { expect, test } from "@playwright/test";
|
|
|
|
|
|
|
|
|
|
test.describe("Invoice Processing filters (AP-43)", () => {
|
|
|
|
|
test("Action and Vendor filters reduce grid rows and badge counts", async ({ page }) => {
|
|
|
|
|
await page.goto("/");
|
|
|
|
|
const grid = page.getByTestId("grid-pending");
|
|
|
|
|
await expect(grid.locator(".MuiDataGrid-row").first()).toBeVisible();
|
|
|
|
|
const before = await grid.locator(".MuiDataGrid-row").count();
|
|
|
|
|
expect(before).toBeGreaterThan(0);
|
|
|
|
|
|
2026-09-25 16:45:14 -04:00
|
|
|
await expect(page.getByTestId("action-filter").getByPlaceholder("Search")).toBeVisible();
|
2026-08-11 15:20:31 -04:00
|
|
|
await page.getByTestId("action-filter").click();
|
|
|
|
|
await page.getByRole("option", { name: "Approve invoice" }).click();
|
|
|
|
|
await expect(page.getByTestId("filter-toggle").locator(".MuiBadge-badge")).toHaveText("1");
|
|
|
|
|
|
|
|
|
|
await page.getByTestId("vendor-filter").fill("Harbor");
|
|
|
|
|
await expect(page.getByTestId("filter-toggle").locator(".MuiBadge-badge")).toHaveText("2");
|
|
|
|
|
await expect(grid.locator(".MuiDataGrid-row")).toHaveCount(1);
|
2026-09-25 17:43:27 -04:00
|
|
|
await expect(page.getByTestId("tab-pending").locator("span").last()).toHaveText("1");
|
2026-09-25 17:20:11 -04:00
|
|
|
await expect(page.getByTestId("attention-banner")).toContainText(
|
|
|
|
|
"1 invoices require approval. Show invoices ready to approve.",
|
|
|
|
|
);
|
2026-08-11 15:20:31 -04:00
|
|
|
});
|
|
|
|
|
});
|