mirror of
https://github.com/Sea-Haven-Industries/seahaven-ap.git
synced 2026-10-01 20:13:22 +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"]'),
|
||||
).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
|
||||
</Typography>
|
||||
<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
|
||||
</Button>
|
||||
<IconButton aria-label="Close columns" onClick={onClose} size="small">
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ import { ColumnsDrawer } from "@/dashboard/ColumnsDrawer";
|
|||
import { InvoiceFilterToolbar } from "@/dashboard/InvoiceFilterToolbar";
|
||||
import { CreatePayRunButton } from "@/dashboard/CreatePayRunButton";
|
||||
import { InvoiceDataGrid } from "@/dashboard/InvoiceDataGrid";
|
||||
import { columnsFromCatalogKeys, readyToPayColumns } from "@/dashboard/columns";
|
||||
import { columnsFromCatalogKeys } from "@/dashboard/columns";
|
||||
import {
|
||||
loadColumnPrefs,
|
||||
resetColumnPrefs,
|
||||
|
|
@ -287,7 +287,7 @@ export function DashboardGrids() {
|
|||
<InvoiceDataGrid
|
||||
data-testid="grid-ready"
|
||||
rows={filteredApproved}
|
||||
columns={readyToPayColumns}
|
||||
columns={catalogColumns}
|
||||
checkboxSelection
|
||||
rowSelectionModel={selection}
|
||||
onRowSelectionModelChange={(model) => setSelection(model)}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue