seahaven-ap/e2e/dashboard-grids.spec.ts
Adam Moussa ee2f7a9902
feat(web): add Columns slide-over with Stampli HTML defaults (AP-45) (#18)
* feat(web): fix shell chrome, logo home, and live nav badges

Refs: AP-42

* feat(web): add invoice grid lines and bold headers

Refs: AP-44

* feat(web): support auto row height for multi-line invoice cells

Refs: AP-44

* feat(web): expand mock invoice fields for Stampli column catalog

Refs: AP-47

* feat(web): add Action and Vendor filters to invoice processing

Refs: AP-43

* feat(web): add multi-line Stampli invoice cell renderers

Refs: AP-47

* feat(web): align filter toolbar layout, field shapes, and tabs

Refs: AP-43

* feat(web): add Columns slide-over with Stampli HTML defaults

Refs: AP-45

* fix(web): address review feedback

* fix(web): address review feedback

* fix(web): address review feedback

* ci: remove the pr policy caller

* fix(web): keep mock catalog dates and updates in sync

* fix(web): render the attention banner as text

* fix(web): keep pay date editable on the approved grid

* fix(web): make the attention banner non-interactive copy

* fix(web): derive mock action labels from invoice status

* fix(web): restore link-style attention banner copy

* fix(ci): drop the unused catalog refresh index

* fix(web): assert the vendor column by its grid field

* fix(ci): format invoice mock helpers

* fix(web): hide Payment Date when the drawer omits it

* fix(web): count filtered rows on invoice tabs

* fix(web): close the columns drawer before editing pay date
2026-09-25 22:28:05 +00:00

89 lines
3.3 KiB
TypeScript

import { expect, test } from "@playwright/test";
test.describe("dashboard grids", () => {
test("home page shows brand and three invoice grids", async ({ page }) => {
await page.goto("/");
await expect(page.getByTestId("app-wordmark")).toContainText("STAMPLI");
await expect(page.getByTestId("mocks-status")).toContainText("Mocks enabled");
await expect(
page.getByTestId("grid-pending").locator(".MuiDataGrid-row").first(),
).toBeVisible();
await page.getByTestId("tab-ready").click();
await expect(page.getByTestId("grid-ready").locator(".MuiDataGrid-row").first()).toBeVisible();
await page.getByTestId("tab-all").click();
await expect(page.getByTestId("grid-all").locator(".MuiDataGrid-row").first()).toBeVisible();
});
test("payment processing select to pay is reachable from module rail", async ({ page }) => {
await page.goto("/");
await page.getByTestId("nav-payment-processing").click();
await expect(page.getByTestId("payment-processing")).toBeVisible();
await expect(page.getByTestId("tab-select-to-pay")).toBeVisible();
await expect(
page.getByTestId("grid-select-to-pay").locator(".MuiDataGrid-row").first(),
).toBeVisible();
});
test("ready to pay supports selection, create pay run stub, and pay-date edit", async ({
page,
}) => {
await page.goto("/");
await page.getByTestId("tab-ready").click();
const createPayRun = page.getByTestId("create-pay-run");
await expect(createPayRun).toBeDisabled();
const readyGrid = page.getByTestId("grid-ready");
await readyGrid.locator(".MuiDataGrid-row").first().getByRole("checkbox").click();
await expect(createPayRun).toBeEnabled();
await createPayRun.click();
await expect(page.getByTestId("create-pay-run-snackbar")).toContainText(
"Pay run stub: 1 invoice(s) selected",
);
await readyGrid.locator('input[aria-label="Select all rows"]').click();
await expect(createPayRun).toBeEnabled();
await createPayRun.click();
await expect(page.getByTestId("create-pay-run-snackbar")).toContainText(
/Pay run stub: [2-9]\d* invoice\(s\) selected/,
);
await page.getByTestId("columns-toggle").click();
const drawer = page.getByTestId("columns-drawer");
await drawer.getByTestId("columns-hidden-search").fill("Payment Date");
await drawer
.getByTestId("columns-hidden-paymentDate")
.locator('input[type="checkbox"]')
.evaluate((el: HTMLInputElement) => {
el.click();
});
await expect(
readyGrid.locator('.MuiDataGrid-columnHeader[data-field="payDate"]'),
).toBeVisible();
await page.getByRole("button", { name: "Close columns" }).evaluate((el: HTMLElement) => {
el.click();
});
await expect(drawer).toBeHidden();
const payDateCell = readyGrid.locator('[data-field="payDate"]').nth(1);
await payDateCell.dblclick();
const editor = readyGrid
.locator('input[name="payDate"], .MuiDataGrid-editInputCell input')
.first();
await editor.fill("2026-09-01");
await editor.press("Enter");
await expect(payDateCell).toContainText("09/01/2026");
await page.getByTestId("tab-pending").click();
await page.getByTestId("tab-ready").click();
await expect(
page.getByTestId("grid-ready").locator('[data-field="payDate"]').nth(1),
).toContainText("09/01/2026");
});
});