Apply brand defaults to MJML survey and product buttons
This commit is contained in:
1 parent
07ed6b2596
commit
b0fca36bca
5 files changed
+23
-3
No files matched your search
@@ -8,7 +8,7 @@ const compile = createRequire(import.meta.url)("mjml");
|
||||
test("MJML preserves document metadata and global typography in compiled HTML", async () => {
|
||||
const document: BlockDocument = {
|
||||
schemaVersion: 1, kind: "email", meta: { subject: 'Brand & "News" <today>', preheader: 'Preview <safe> & useful', lang: "en" }, theme: { tokens: {} },
|
||||
root: { id: "root", type: "layout.email-document", version: 1, props: { width: "600", fontFamily: "Georgia, serif", textColor: "#123456" }, styles: {}, slots: {
|
||||
root: { id: "root", type: "layout.email-document", version: 1, props: { width: "600", fontFamily: "Georgia, serif", textColor: "#123456", linkColor: "#a12345" }, styles: {}, slots: {
|
||||
content: [{ id: "text", type: "content.text", version: 1, props: { text: "Brand text" }, styles: {}, slots: {} }, { id: "button", type: "content.button", version: 1, props: { label: "Brand action", href: "https://example.com" }, styles: {}, slots: {} }],
|
||||
} },
|
||||
};
|
||||
@@ -35,6 +35,7 @@ test("MJML preserves document metadata and global typography in compiled HTML",
|
||||
expect(imported.value.meta.preheader).toBe(document.meta.preheader);
|
||||
expect(imported.value.root.props.fontFamily).toBe("Georgia, serif");
|
||||
expect(imported.value.root.props.textColor).toBe("#123456");
|
||||
expect(imported.value.root.props.linkColor).toBe("#a12345");
|
||||
const rerendered = await renderEmail(imported.value, { mjml: true });
|
||||
expect(rerendered.ok).toBe(true);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user