19 lines
709 B
TypeScript
19 lines
709 B
TypeScript
import { describe, expect, test } from "vitest";
|
|
import { buildBrand, defaultMailBrand } from "./render.js";
|
|
|
|
describe("buildBrand", () => {
|
|
test("returns the default brand when no override is supplied", () => {
|
|
expect(buildBrand()).toEqual(defaultMailBrand);
|
|
});
|
|
|
|
test("merges a partial override on top of the default brand", () => {
|
|
const brand = buildBrand({ productName: "Acme", primaryColor: "#123456" });
|
|
|
|
expect(brand.productName).toBe("Acme");
|
|
expect(brand.primaryColor).toBe("#123456");
|
|
// Untouched tokens fall back to the defaults.
|
|
expect(brand.supportEmail).toBe(defaultMailBrand.supportEmail);
|
|
expect(brand.linkColor).toBe(defaultMailBrand.linkColor);
|
|
});
|
|
});
|