import { describe, expect, it } from "vitest"; import { facetCount, facetsFromQuery, facetsToQuery } from "./facets"; describe("the board's filter URL", () => { it("round-trips the facets the Filters panel offers", () => { const query = { q: "milk", label: ["a", "b"], has_attachment: "true", shared: "with_me" }; const facets = facetsFromQuery(query); expect(facetsToQuery(facets)).toEqual(query); expect(facetCount(facets)).toBe(5); }); // Removed in #5180: reminders have their own lens and dates are Timeline's. A link // saved before then must open the plain board, not one filtered with no chip to say so. it("ignores the reminder and date keys an old link may carry", () => { const facets = facetsFromQuery({ has_reminder: "true", created_after: "2026-01-01T00:00:00", created_before: "2026-02-01T00:00:00", }); expect(facets).toEqual({}); expect(facetCount(facets)).toBe(0); }); });