mirror of
https://github.com/Hestia-Homes/assessment-model.git
synced 2026-06-30 12:55:02 +00:00
31 lines
1 KiB
TypeScript
31 lines
1 KiB
TypeScript
import { describe, expect, it } from "vitest";
|
|
import { buildMailHeaders } from "./buildMailHeaders";
|
|
|
|
describe("buildMailHeaders", () => {
|
|
it("includes X-SES-CONFIGURATION-SET when a configuration set is provided", () => {
|
|
const headers = buildMailHeaders({
|
|
fromAddress: "test-sender@example.test",
|
|
sesConfigurationSet: "test-config-set",
|
|
});
|
|
|
|
expect(headers["X-SES-CONFIGURATION-SET"]).toBe("test-config-set");
|
|
});
|
|
|
|
it("omits X-SES-CONFIGURATION-SET entirely when no configuration set is provided", () => {
|
|
const headers = buildMailHeaders({
|
|
fromAddress: "test-sender@example.test",
|
|
sesConfigurationSet: undefined,
|
|
});
|
|
|
|
expect(headers).not.toHaveProperty("X-SES-CONFIGURATION-SET");
|
|
});
|
|
|
|
it("always includes a List-Unsubscribe mailto pointing at the from address", () => {
|
|
const headers = buildMailHeaders({
|
|
fromAddress: "test-sender@example.test",
|
|
sesConfigurationSet: undefined,
|
|
});
|
|
|
|
expect(headers["List-Unsubscribe"]).toBe("<mailto:test-sender@example.test>");
|
|
});
|
|
});
|