diff --git a/frontend/src/components/ui/stickyTop.dom.test.tsx b/frontend/src/components/ui/stickyTop.dom.test.tsx index 427984a5..373becbc 100644 --- a/frontend/src/components/ui/stickyTop.dom.test.tsx +++ b/frontend/src/components/ui/stickyTop.dom.test.tsx @@ -22,6 +22,8 @@ vi.mock("react-i18next", async (importOriginal) => { import PageScroller from "./PageScroller"; import { ColumnHead } from "./tableHeader"; +const last = () => fadeTopArgs[fadeTopArgs.length - 1]; + afterEach(() => { cleanup(); fadeTopArgs.length = 0; @@ -50,13 +52,13 @@ function page(withTable: boolean) { describe("the page scroller's top fade and a sticky table header", () => { it("is off while the header is mounted, and back on the moment it is gone", () => { const view = render(page(true)); - expect(fadeTopArgs.at(-1)).toBe(false); + expect(last()).toBe(false); view.rerender(page(false)); // e.g. the Channels card layout, or a narrow DataTable - expect(fadeTopArgs.at(-1)).toBe(true); + expect(last()).toBe(true); }); it("is on for a page with no sticky header at all", () => { render(page(false)); - expect(fadeTopArgs.at(-1)).toBe(true); + expect(last()).toBe(true); }); }); diff --git a/frontend/src/lib/pxBox.contract.test.ts b/frontend/src/lib/pxBox.contract.test.ts index d8421751..1d1e34f2 100644 --- a/frontend/src/lib/pxBox.contract.test.ts +++ b/frontend/src/lib/pxBox.contract.test.ts @@ -15,8 +15,10 @@ async function refused(source: string): Promise { describe("a px-frozen box utility", () => { it("is refused in a string and in a template literal", async () => { - expect(await refused('export const a = "group w-[150px] shrink-0";\n')).toBe(1); - expect(await refused("export const b = `x ${1} max-w-[240px]`;\n")).toBe(1); + // Assembled, so this file does not trip the very rule it probes. + const px = (u: string, n: number) => `${u}-[${n}px]`; + expect(await refused(`export const a = "group ${px("w", 150)} shrink-0";\n`)).toBe(1); + expect(await refused("export const b = `x ${1} " + px("max-w", 240) + "`;\n")).toBe(1); }); it("leaves the spacing scale, a rem arbitrary and a grid track alone", async () => {