fix(email-renderer): inherit global brand fonts in content blocks
This commit is contained in:
1 parent
2cd8f8ea14
commit
1143da808f
3 files changed
+20
-9
No files matched your search
@@ -56,6 +56,17 @@ const document: BlockDocument = {
|
||||
};
|
||||
|
||||
describe("email renderer", () => {
|
||||
test("content inherits the selected brand font instead of overriding it", async () => {
|
||||
const branded = structuredClone(document);
|
||||
branded.root.props.fontFamily = "Georgia, serif";
|
||||
const result = await renderEmail(branded);
|
||||
expect(result.ok).toBe(true);
|
||||
if (!result.ok) return;
|
||||
expect(result.value.parts.html.content).toContain("font-family:Georgia, serif");
|
||||
expect(result.value.parts.html.content).not.toContain("font-family:Arial");
|
||||
expect(result.value.parts.html.content).toContain('<h1 style="font-family:inherit');
|
||||
expect(result.value.parts.html.content).toContain("display:inline-block;font-family:inherit");
|
||||
});
|
||||
test("browser HTML parsing preserves every block inside its section", async () => {
|
||||
const rendered = await renderEmail(document);
|
||||
expect(rendered.ok).toBe(true);
|
||||
|
||||
Reference in new issue
Block a user