diff --git a/e2e/invoice-filters.spec.ts b/e2e/invoice-filters.spec.ts index 49f1db1..2b5588f 100644 --- a/e2e/invoice-filters.spec.ts +++ b/e2e/invoice-filters.spec.ts @@ -8,6 +8,7 @@ test.describe("Invoice Processing filters (AP-43)", () => { const before = await grid.locator(".MuiDataGrid-row").count(); expect(before).toBeGreaterThan(0); + await expect(page.getByTestId("action-filter").getByPlaceholder("Search")).toBeVisible(); 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"); @@ -15,5 +16,6 @@ test.describe("Invoice Processing filters (AP-43)", () => { 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); + await expect(page.getByTestId("attention-banner")).toContainText("1 invoices require approval"); }); }); diff --git a/src/dashboard/DashboardGrids.tsx b/src/dashboard/DashboardGrids.tsx index e7d8a55..a51520b 100644 --- a/src/dashboard/DashboardGrids.tsx +++ b/src/dashboard/DashboardGrids.tsx @@ -118,7 +118,7 @@ export function DashboardGrids() { const selectedCount = countSelectedRows( selection, - filteredApproved.map((invoice) => invoice.id), + approvedRows.map((invoice) => invoice.id), ); const processRowUpdate = async (newRow: MockInvoice, oldRow: MockInvoice) => { @@ -218,7 +218,7 @@ export function DashboardGrids() { - {attentionRows.length > 0 && tab === "attention" ? ( + {filteredAttention.length > 0 && tab === "attention" ? ( - {attentionRows.length} invoices require approval. Show invoices ready to approve. + {filteredAttention.length} invoices require approval. Show invoices ready to approve. ) : null} diff --git a/src/dashboard/InvoiceFilterToolbar.tsx b/src/dashboard/InvoiceFilterToolbar.tsx index ee1f548..5e6a0c2 100644 --- a/src/dashboard/InvoiceFilterToolbar.tsx +++ b/src/dashboard/InvoiceFilterToolbar.tsx @@ -52,7 +52,7 @@ export function InvoiceFilterToolbar({ renderInput={(params) => (