mirror of
https://github.com/Sea-Haven-Industries/seahaven-ap.git
synced 2026-10-07 06:58:53 +00:00
fix(web): address review feedback
This commit is contained in:
parent
91a39f8ba2
commit
a9e6239c3f
3 changed files with 35 additions and 3 deletions
|
|
@ -27,4 +27,28 @@ test.describe("Invoice Processing columns drawer (AP-45)", () => {
|
||||||
page.getByTestId("grid-pending").locator('.MuiDataGrid-columnHeader[data-field="tagging"]'),
|
page.getByTestId("grid-pending").locator('.MuiDataGrid-columnHeader[data-field="tagging"]'),
|
||||||
).toBeVisible();
|
).toBeVisible();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test("locked Vendor column stays visible and Reset clears the hidden search", async ({
|
||||||
|
page,
|
||||||
|
}) => {
|
||||||
|
await page.goto("/");
|
||||||
|
await page.getByTestId("columns-toggle").click();
|
||||||
|
const drawer = page.getByTestId("columns-drawer");
|
||||||
|
const vendorBox = drawer.getByTestId("columns-visible-vendor").locator('input[type="checkbox"]');
|
||||||
|
await expect(vendorBox).toBeDisabled();
|
||||||
|
await vendorBox.evaluate((el: HTMLInputElement) => {
|
||||||
|
el.disabled = false;
|
||||||
|
el.click();
|
||||||
|
});
|
||||||
|
await expect(
|
||||||
|
page.getByTestId("grid-pending").locator('.MuiDataGrid-columnHeader[data-field="vendor"]'),
|
||||||
|
).toBeVisible();
|
||||||
|
|
||||||
|
const search = drawer.getByTestId("columns-hidden-search");
|
||||||
|
await search.fill("no-such-column");
|
||||||
|
await drawer.getByTestId("columns-selector-reset-button").evaluate((el: HTMLElement) => {
|
||||||
|
el.click();
|
||||||
|
});
|
||||||
|
await expect(search).toHaveValue("");
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -143,7 +143,15 @@ export function ColumnsDrawer({
|
||||||
Columns
|
Columns
|
||||||
</Typography>
|
</Typography>
|
||||||
<Stack direction="row" spacing={1}>
|
<Stack direction="row" spacing={1}>
|
||||||
<Button size="small" data-testid="columns-selector-reset-button" onClick={onReset}>
|
<Button
|
||||||
|
size="small"
|
||||||
|
data-testid="columns-selector-reset-button"
|
||||||
|
onClick={() => {
|
||||||
|
setHiddenQuery("");
|
||||||
|
setViewAllHidden(false);
|
||||||
|
onReset();
|
||||||
|
}}
|
||||||
|
>
|
||||||
Reset
|
Reset
|
||||||
</Button>
|
</Button>
|
||||||
<IconButton aria-label="Close columns" onClick={onClose} size="small">
|
<IconButton aria-label="Close columns" onClick={onClose} size="small">
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ import { ColumnsDrawer } from "@/dashboard/ColumnsDrawer";
|
||||||
import { InvoiceFilterToolbar } from "@/dashboard/InvoiceFilterToolbar";
|
import { InvoiceFilterToolbar } from "@/dashboard/InvoiceFilterToolbar";
|
||||||
import { CreatePayRunButton } from "@/dashboard/CreatePayRunButton";
|
import { CreatePayRunButton } from "@/dashboard/CreatePayRunButton";
|
||||||
import { InvoiceDataGrid } from "@/dashboard/InvoiceDataGrid";
|
import { InvoiceDataGrid } from "@/dashboard/InvoiceDataGrid";
|
||||||
import { columnsFromCatalogKeys, readyToPayColumns } from "@/dashboard/columns";
|
import { columnsFromCatalogKeys } from "@/dashboard/columns";
|
||||||
import {
|
import {
|
||||||
loadColumnPrefs,
|
loadColumnPrefs,
|
||||||
resetColumnPrefs,
|
resetColumnPrefs,
|
||||||
|
|
@ -287,7 +287,7 @@ export function DashboardGrids() {
|
||||||
<InvoiceDataGrid
|
<InvoiceDataGrid
|
||||||
data-testid="grid-ready"
|
data-testid="grid-ready"
|
||||||
rows={filteredApproved}
|
rows={filteredApproved}
|
||||||
columns={readyToPayColumns}
|
columns={catalogColumns}
|
||||||
checkboxSelection
|
checkboxSelection
|
||||||
rowSelectionModel={selection}
|
rowSelectionModel={selection}
|
||||||
onRowSelectionModelChange={(model) => setSelection(model)}
|
onRowSelectionModelChange={(model) => setSelection(model)}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue