feat(email-renderer): add marketing and commerce blocks
Quality / quality (ubuntu-latest) (push) Failing after 9m58s
Quality / quality (windows-latest) (push) Canceled after 0s

This commit is contained in:
Clintchiz committed 2026-09-05 10:53:22 +05:30
1 parent edccf06658
commit 6cdd39ba38
3 files changed
+122 -1

No files matched your search

@@ -1,5 +1,6 @@
import { describe, expect, test } from "bun:test";
import {
emailCoreBlocks,
renderEmail,
validateAmpEmail,
validateMjml,
@@ -91,4 +92,23 @@ describe("email renderer", () => {
(await validateMjml("<mjml><mj-body><mj-text>x</mj-text></mj-body></mjml>")).length,
).toBeGreaterThan(0);
});
test("ships the complete marketing block pack", () => {
expect(emailCoreBlocks.map((block) => block.manifest.type)).toEqual(
expect.arrayContaining([
"content.video",
"content.social",
"content.countdown",
"content.survey",
"content.feed-item",
"commerce.product",
]),
);
for (const block of emailCoreBlocks) {
expect(block.textRenderer).toBeFunction();
expect(block.renderers?.emailHtml).toBeFunction();
expect(block.renderers?.ampEmail).toBeFunction();
expect(block.renderers?.mjml).toBeFunction();
}
});
});