Skip to content

Open-source manufacturing ERP, MES and QMS. Quoting, MRP, inventory, shop floor, quality and lot/serial traceability on one Postgres schema, with a REST API and MCP server. Self-host or use Carbon Cloud.

test(documents): account for watermark built-in block

Sidwebworksd4a61c4ea080
diff --git a/packages/documents/src/template/template.test.ts b/packages/documents/src/template/template.test.ts
index 839a8f1b15..1fddedc8fb 100644
--- a/packages/documents/src/template/template.test.ts
+++ b/packages/documents/src/template/template.test.ts
@@ -33,9 +33,12 @@ describe("resolveTemplate", () => {
"header",
"parties",
"notes",
- "terms"
+ "terms",
+ // watermark is a built-in not in the stored set, appended hidden
+ "watermark"
]);
expect(blocks.find((b) => b.type === "header")?.visible).toBe(false);
+ expect(blocks.find((b) => b.type === "watermark")?.visible).toBe(false);
});
it("appends missing built-in blocks as hidden", () => {
@@ -133,6 +136,6 @@ describe("schema validation", () => {
it("validates a full template document", () => {
const parsed = documentTemplateSchema.parse(DEFAULT_SALES_INVOICE_TEMPLATE);
- expect(parsed.blocks).toHaveLength(6);
+ expect(parsed.blocks).toHaveLength(7);
});
});