feat: 按模板要求校验信任内容发布
This commit is contained in:
1 parent
e3a4074d8e
commit
5ed06b1abe
10 files changed
+71
-16
No files matched your search
@@ -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 } });
|
||||
|
||||
Reference in new issue
Block a user