feat: release design system engine, studio and component contracts
This commit is contained in:
1 parent
ff1065fb27
commit
3943b946d6
693 files changed
+175546
-3894
No files matched your search
@@ -3,10 +3,37 @@ import { renderEmail } from "../src/index.ts";
|
||||
|
||||
test("explicit heading sizes are not multiplied by browser heading defaults", async () => {
|
||||
for (const size of [undefined, "36px", "expression(1)"]) {
|
||||
const result = await renderEmail({schemaVersion:1,kind:"email",meta:{subject:"Typography",lang:"en"},theme:{tokens:{}},root:{id:"root",type:"layout.email-document",version:1,props:{width:"600"},styles:{},slots:{content:[{id:"heading",type:"content.heading",version:1,props:{text:"Design that works",level:"1"},styles:size?{fontSize:{base:size}}:{},slots:{}}]}}}, {amp:false,mjml:false});
|
||||
const result = await renderEmail(
|
||||
{
|
||||
schemaVersion: 1,
|
||||
kind: "email",
|
||||
meta: { subject: "Typography", lang: "en" },
|
||||
theme: { tokens: {} },
|
||||
root: {
|
||||
id: "root",
|
||||
type: "layout.email-document",
|
||||
version: 1,
|
||||
props: { width: "600" },
|
||||
styles: {},
|
||||
slots: {
|
||||
content: [
|
||||
{
|
||||
id: "heading",
|
||||
type: "content.heading",
|
||||
version: 1,
|
||||
props: { text: "Design that works", level: "1" },
|
||||
styles: size ? { fontSize: { base: size } } : {},
|
||||
slots: {},
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
},
|
||||
{ amp: false, mjml: false },
|
||||
);
|
||||
expect(result.ok).toBe(true);
|
||||
if (!result.ok) continue;
|
||||
const html=result.value.parts.html.content;
|
||||
const html = result.value.parts.html.content;
|
||||
expect(html.includes("font-size:inherit;line-height:1.2;")).toBe(size === "36px");
|
||||
expect(html).not.toContain("expression(");
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user