feat: 完善模板内容后台配置能力

This commit is contained in:
que01 committed 2026-09-28 17:30:34 +08:00
1 parent 2bc2193b44
commit 9266ec824a
37 files changed
+2273 -63

No files matched your search

@@ -25,3 +25,37 @@ test("template contract rejects technical or incomplete admin declarations", ()
"every admin field requires key, binding and label",
]);
});
test("template manifests declare editable material content", () => {
const linjing = JSON.parse(
fs.readFileSync(path.join(packageRoot, "template-linjing-editorial/template.json"), "utf8"),
);
const acheng = JSON.parse(
fs.readFileSync(path.join(packageRoot, "template-acheng-campus-food/template.json"), "utf8"),
);
const bindings = (manifest) =>
new Set(
manifest.admin.sections.flatMap((section) => section.fields.map((field) => field.binding)),
);
for (const binding of [
"brand.config.homeHero.title",
"brand.config.profilePresentation.coverage",
"brand.config.profilePresentation.warranty",
"offering.config.area",
"offering.config.details.designConcept",
"brand.config.visualPresentation.offerings.closingText",
])
assert.ok(bindings(linjing).has(binding), binding);
for (const binding of [
"brand.config.visualPresentation.profile.coverageContent",
"brand.config.visualPresentation.offerings.menuTip",
"brand.config.visualPresentation.inquiry.promise",
])
assert.ok(bindings(acheng).has(binding), binding);
assert.deepEqual(
linjing.trustContentTypes
.find((item) => item.type === "credential")
.configFields.map((field) => field.key),
["stats", "pillars", "serviceFlow"],
);
});