diff --git a/apps/api/test/http.integration.test.js b/apps/api/test/http.integration.test.js index 40b0f71..3a05c79 100644 --- a/apps/api/test/http.integration.test.js +++ b/apps/api/test/http.integration.test.js @@ -709,6 +709,9 @@ test("admin can install doors industry template through the shared runtime contr test("admin can preview and import sample content idempotently", async () => { const originalBrand = await prisma.brandProfile.findUnique({ where: { id: brandId } }); + const originalSampleTrust = await prisma.trustContent.findMany({ + where: { brandId, content: "示例内容,待品牌主理人完善。" }, + }); await prisma.brandProfile.update({ where: { id: brandId }, data: { templateKey: "doors" } }); await prisma.offering.deleteMany({ where: { @@ -748,6 +751,13 @@ test("admin can preview and import sample content idempotently", async () => { await prisma.trustContent.deleteMany({ where: { brandId, content: "示例内容,待品牌主理人完善。" }, }); + if (originalSampleTrust.length) { + await prisma.trustContent.createMany({ + data: originalSampleTrust.map( + ({ id: _id, createdAt: _createdAt, updatedAt: _updatedAt, ...item }) => item, + ), + }); + } await prisma.brandFieldDefinition.deleteMany({ where: { brandId, source: "sample" } }); await prisma.capabilityAuditLog.deleteMany({ where: { brandId, capabilityKey: "doors" } }); await prisma.brandProfile.update({