Update hivegrid-cloud reference to latest main
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
e98d38e716
commit
7b21524c86
3781 files changed
+373484
-225607
No files matched your search
@@ -0,0 +1,48 @@
|
||||
import { describe, it, expect } from "vitest";
|
||||
import {
|
||||
theme,
|
||||
renderEmail,
|
||||
htmlToPlainText,
|
||||
Layout,
|
||||
Heading,
|
||||
Paragraph,
|
||||
Spacer,
|
||||
Button,
|
||||
Footer,
|
||||
WelcomeEmail,
|
||||
TrialReminderEmail,
|
||||
ReActivationEmail,
|
||||
GenericStepEmail,
|
||||
} from "./index.js";
|
||||
|
||||
describe("public API barrel", () => {
|
||||
it("re-exports the render helpers and theme tokens", () => {
|
||||
expect(typeof renderEmail).toBe("function");
|
||||
expect(typeof htmlToPlainText).toBe("function");
|
||||
expect(htmlToPlainText("<p>Hello</p>")).toBe("Hello");
|
||||
expect(theme.colors.primary).toBe("#2563eb");
|
||||
expect(theme.containerWidth).toBe(600);
|
||||
});
|
||||
|
||||
it("re-exports the layout and primitive components", () => {
|
||||
for (const component of [Layout, Heading, Paragraph, Spacer, Button, Footer]) {
|
||||
expect(typeof component).toBe("function");
|
||||
}
|
||||
});
|
||||
|
||||
it("re-exports every sequence template and renders through the barrel", () => {
|
||||
for (const template of [WelcomeEmail, TrialReminderEmail, ReActivationEmail, GenericStepEmail]) {
|
||||
expect(typeof template).toBe("function");
|
||||
}
|
||||
const { html, text } = renderEmail(
|
||||
WelcomeEmail({
|
||||
productName: "ToolCtrl",
|
||||
ctaUrl: "https://app.example.com/onboard",
|
||||
unsubscribeUrl: "https://app.example.com/unsubscribe/tok",
|
||||
})
|
||||
);
|
||||
expect(html.startsWith("<!DOCTYPE html>")).toBe(true);
|
||||
expect(html).toContain("Welcome to ToolCtrl");
|
||||
expect(text).toContain("Welcome to ToolCtrl");
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user