From c46297b13b65085f10ebce370ec2601c1b7cfe86 Mon Sep 17 00:00:00 2001 From: que01 Date: Fri, 25 Sep 2026 17:17:12 +0800 Subject: [PATCH] =?UTF-8?q?test:=20=E9=9A=94=E7=A6=BB=E7=A4=BA=E4=BE=8B?= =?UTF-8?q?=E5=86=85=E5=AE=B9=E6=B5=8B=E8=AF=95=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/api/test/http.integration.test.js | 10 ++++++++++ 1 file changed, 10 insertions(+) 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({