Add the Monolith and Cobalt Stripe templates

Standalone layouts for reference templates 3 and 8, with the user's logo sized to the
placeholder box, a CapRule decor primitive, optional TableRows rule/heading options,
and a separate 1..45-row sweep test file.
This commit is contained in:
2026-10-04 11:25:19 +05:30
parent 4cea3fdd8e
commit dd85c3b3c5
26 changed files with 2795 additions and 37 deletions
+2 -19
View File
@@ -1,21 +1,4 @@
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";
import { describeSweep, STANDALONE_SWEEP } from "./harness.sweep";
// 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)`);
}
});
}
}
});
describeSweep((id) => !STANDALONE_SWEEP.includes(id));