Add the Monolith and Cobalt Stripe templates
Standalone layouts for Canva 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:
@@ -0,0 +1,25 @@
|
||||
import { describe, it } from "vitest";
|
||||
import { makeItems, prefsFor, PAGE_SIZE_IDS, renderFixture, type FixtureSpec } from "./harness";
|
||||
import { checkRendered } from "./harness.check";
|
||||
import { TEMPLATES } from "./registry";
|
||||
|
||||
/** The standalone templates sweep in a file of their own, so vitest runs the two sweeps in parallel and the suite's wall time stays put. */
|
||||
export const STANDALONE_SWEEP = ["monolith", "cobalt-stripe"];
|
||||
|
||||
/** 1..45 generated rows on A4 and Letter for the templates `pick` selects, each render through the harness checks. */
|
||||
export function describeSweep(pick: (id: string) => boolean): void {
|
||||
describe("template harness: item-count sweep", () => {
|
||||
for (const template of Object.values(TEMPLATES).filter((t) => pick(t.id))) {
|
||||
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)`);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user