refactor: 收敛公开工作区运行时契约

This commit is contained in:
que01 committed 2026-09-25 12:19:20 +08:00
1 parent d5e63be074
commit 9b61047ec6
13 files changed
+93 -64

No files matched your search

@@ -44,6 +44,19 @@ test("已发布 workspace 正常返回", async () => {
assert.equal(workspace.brand.name, "测试品牌");
});
test("运行时只消费 canonical workspace 字段", async () => {
const workspace = await loadWithResponse({
publication: { status: "published" },
brand: { name: "测试品牌" },
offerings: [],
trustPresentation: { bio: "品牌介绍" },
inquiryForms: [],
});
assert.deepEqual(workspace.trustContent, { bio: "品牌介绍" });
assert.equal(workspace.fields, undefined);
assert.equal(workspace.inquiryForm, undefined);
});
test("模板声明的业务提供项展示字段会保留在小程序 view model", async () => {
const workspace = await loadWithResponse({
publication: { status: "published" },