diff --git a/packages/mail/src/index.test.tsx b/packages/mail/src/index.test.tsx new file mode 100644 index 0000000..7150614 --- /dev/null +++ b/packages/mail/src/index.test.tsx @@ -0,0 +1,25 @@ +import { describe, it, expect } from "vitest"; +import * as React from "react"; +import { render } from "./index"; +import { MintelLogo } from "./components/MintelLogo"; +import { ContactFormNotification } from "./templates/ContactFormNotification"; + +describe("@mintel/mail rendering", () => { + it("should render the MintelLogo to HTML", async () => { + const html = await render(React.createElement(MintelLogo)); + expect(html).toContain("Mintel Logo"); + }); + + it("should render a ContactFormNotification to HTML", async () => { + const html = await render( + React.createElement(ContactFormNotification, { + name: "Test User", + email: "test@example.com", + message: "Hello World", + }), + ); + expect(html).toContain("New Submission"); + expect(html).toContain("Test User"); + expect(html).toContain("test@example.com"); + }); +});