Preserve configured brand logo dimensions across email targets
This commit is contained in:
1 parent
c023a98052
commit
33e350a66a
3 files changed
+17
-5
No files matched your search
@@ -111,6 +111,8 @@ describe("email renderer", () => {
|
||||
const draft = structuredClone(document);
|
||||
draft.root.props.logoUrl = "https://example.com/logo.png";
|
||||
draft.root.props.logoAlt = 'Brand & "Company"';
|
||||
draft.root.props.logoWidth = "180";
|
||||
draft.root.props.logoHeight = "90";
|
||||
const result = await renderEmail(draft,{amp:true,mjml:true});
|
||||
expect(result.ok).toBe(true);
|
||||
if (!result.ok) return;
|
||||
@@ -120,6 +122,14 @@ describe("email renderer", () => {
|
||||
}
|
||||
expect(result.value.parts.amp?.validation.valid).toBe(true);
|
||||
expect(await validateMjml(result.value.exports!.mjml!)).toEqual([]);
|
||||
expect(result.value.parts.html.content).toContain('width="180" height="90"');
|
||||
expect(result.value.parts.amp?.content).toContain('width="180" height="90"');
|
||||
expect(result.value.exports?.mjml).toContain('width="180px" height="90px"');
|
||||
for (const value of ["0", "4001", "180px", "1;display:none"]) {
|
||||
const invalid = structuredClone(draft);
|
||||
invalid.root.props.logoWidth = value;
|
||||
expect((await renderEmail(invalid)).ok).toBe(false);
|
||||
}
|
||||
draft.root.props.logoUrl = "";
|
||||
const empty = await renderEmail(draft,{amp:true,mjml:true});
|
||||
expect(empty.ok).toBe(true);
|
||||
|
||||
Reference in new issue
Block a user