import { describe, expect, it } from "vitest"; import { themeManifestSchema } from "../src/theme.js"; describe("主题清单", () => { it("允许主题推荐页边距、页眉和页码配置", () => { const parsed = themeManifestSchema.parse({ manifestVersion: 1, id: "official-test", name: "公文测试主题", version: "0.5.1", description: "测试主题推荐页面配置。", author: "md-to-pdf contributors", license: "项目自有", entry: "theme.css", domPreset: "generic", defaultFontSize: "21.333px", supportedFeatures: ["table"], category: "red-letter", compatibleProfiles: ["official"], pageDefaults: { margins: { top: "37mm", right: "26mm", bottom: "35mm", left: "28mm" }, header: { enabled: false, height: "8mm", showDivider: false, fontSize: "4.94mm", fontFamily: '"Mdpdf Fandol Song", SimSun, serif', color: "#000000", left: { enabled: false, content: "" }, center: { enabled: false, content: "" }, right: { enabled: false, content: "" } }, footer: { enabled: true, height: "7mm", showDivider: false, fontSize: "4.94mm", fontFamily: '"Mdpdf Fandol Song", SimSun, serif', color: "#000000", alignment: "outer", format: "official-page", startFrom: 1, showOnFirstPage: false } }, bundled: true }); expect(parsed.pageDefaults?.footer).toMatchObject({ alignment: "outer", format: "official-page", showOnFirstPage: false }); }); });