feat: 按模板要求校验信任内容发布

This commit is contained in:
que01 committed 2026-09-27 13:57:16 +08:00
1 parent e3a4074d8e
commit 5ed06b1abe
10 files changed
+71 -16

No files matched your search

+24
View File
@@ -94,6 +94,30 @@ test("admin release lifecycle is authorized, brand-scoped, and versioned", async
data: { isEnabled: true },
});
}
const scheduleTrust = await prisma.trustContent.findFirst({
where: { brandId, type: "schedule", isPublished: true },
});
assert.ok(scheduleTrust);
await prisma.trustContent.update({
where: { id: scheduleTrust.id },
data: { isPublished: false },
});
try {
const missingTrust = await request("/admin/releases/readiness", {
headers: { authorization: `Bearer ${adminToken}` },
});
const missingTrustBody = JSON.parse(missingTrust.body);
assert.equal(missingTrustBody.ready, false);
assert.equal(
missingTrustBody.checks.find((check) => check.key === "trust:schedule")?.passed,
false,
);
} finally {
await prisma.trustContent.update({
where: { id: scheduleTrust.id },
data: { isPublished: true },
});
}
const originalBrand = await prisma.brandProfile.findUniqueOrThrow({ where: { id: brandId } });
const originalConfig = originalBrand.config;
const originalOffering = await prisma.offering.findFirstOrThrow({ where: { brandId } });