import { describe, expect, it } from "vitest"; import { makeItems, prefsFor, PAGE_SIZE_IDS, renderFixture, type FixtureSpec } from "./harness"; import { checkRendered } from "./harness.check"; import { TEMPLATES } from "./registry"; // Its own file so vitest runs the long item-count sweeps in parallel with the fixture matrix. describe("template harness: item-count sweep", () => { for (const template of Object.values(TEMPLATES)) { for (const size of PAGE_SIZE_IDS) { it(`${template.id}: 1..45 items on ${size}`, async () => { const prefs = prefsFor(size, { templateId: template.id }); for (let count = 1; count <= 45; count++) { const spec: FixtureSpec = { name: `sweep-${count}`, items: makeItems(count, true), invoice: { notes: count % 3 === 0 ? "Payment due within 30 days.\nThank you." : "" }, signature: count % 2 === 0 }; const r = await renderFixture(spec, prefs); checkRendered(r, `${template.id}/items=${count}/${size} (${r.result.pages} pages)`); } }); } } });