test(collection-map): pin toolbar shape to prevent filter-chip regression
This commit is contained in:
parent
adfde8a0fa
commit
ee9a0e1001
1 changed files with 34 additions and 0 deletions
|
|
@ -1,3 +1,6 @@
|
|||
// @vitest-environment node
|
||||
import fs from "fs";
|
||||
import path from "path";
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { splitSupplierBucket } from "./pin-model";
|
||||
|
||||
|
|
@ -62,3 +65,34 @@ describe("splitSupplierBucket", () => {
|
|||
expect(assignedByDriver.get("u-1")?.readyAll).toBe(false);
|
||||
});
|
||||
});
|
||||
|
||||
describe("collection-map toolbar shape contract", () => {
|
||||
// The toolbar lives in page.tsx. We snapshot the literal labels that must
|
||||
// remain visible (date + quick chips + Refresh + overlays) and the labels
|
||||
// that must NOT come back (the deleted filter chips + Drivers card).
|
||||
// These are static source-text assertions: a future PR that re-adds the
|
||||
// filter chips won't pass the pipeline, even if the chips "look right".
|
||||
const src = fs.readFileSync(path.resolve(__dirname, "./page.tsx"), "utf8");
|
||||
|
||||
it("renders the locked toolbar labels", () => {
|
||||
// Quick-chip labels.
|
||||
expect(src).toMatch(/Today/);
|
||||
expect(src).toMatch(/Tomorrow/);
|
||||
expect(src).toMatch(/\+3 days/);
|
||||
expect(src).toMatch(/Next week/);
|
||||
// Overlay buttons + manual refresh.
|
||||
expect(src).toMatch(/Traffic/);
|
||||
expect(src).toMatch(/Fullscreen|Exit fullscreen|Minimize2/);
|
||||
expect(src).toMatch(/Refresh/);
|
||||
});
|
||||
|
||||
it("does not re-introduce the deleted filter chips", () => {
|
||||
// State + JSX for the deleted chips — must not silently come back.
|
||||
expect(src).not.toMatch(/setStatusFilter|statusFilter|StatusFilter/);
|
||||
expect(src).not.toMatch(/setReadyFilter|readyFilter/);
|
||||
// Search input + placeholder.
|
||||
expect(src).not.toMatch(/Search PO, supplier/);
|
||||
// Drivers sidebar card heading.
|
||||
expect(src).not.toMatch(/>\s*Drivers\s*</);
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue