From 9029375247c18fd851d40158790efd5c9f9b677c Mon Sep 17 00:00:00 2001 From: Marc Mintel Date: Thu, 5 Feb 2026 01:27:47 +0100 Subject: [PATCH] test: add rendering tests for MintelLogo and ContactFormNotification mail components. --- packages/mail/src/index.test.tsx | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 packages/mail/src/index.test.tsx 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"); + }); +});