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); 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); }); });