feat: 合并品牌能力安装运行时状态

This commit is contained in:
que01 committed 2026-09-23 00:43:57 +08:00
1 parent 21c40b8e10
commit 1f792bd622
3 files changed
+79 -32

No files matched your search

+29
View File
@@ -60,6 +60,35 @@ test("health and public content are available without authentication", async ()
assert.ok(Array.isArray(runtime.plugins));
});
test("public workspace uses brand-scoped capability installations and preserves status", async () => {
await prisma.capabilityInstallation.deleteMany({ where: { brandId } });
const installation = await prisma.capabilityInstallation.create({
data: {
brandId,
capabilityKey: "inquiry",
capabilityVersion: "1.0.0",
status: "disabled",
config: { source: "integration-test" },
},
});
try {
const response = await request("/public/workspace");
assert.equal(response.statusCode, 200);
const body = JSON.parse(response.body);
assert.deepEqual(body.capabilities, [
{
key: "inquiry",
version: "1.0.0",
status: "disabled",
config: { source: "integration-test" },
},
]);
assert.notEqual(body.capabilities[0].status, "enabled");
} finally {
await prisma.capabilityInstallation.delete({ where: { id: installation.id } });
}
});
test("admin can install a template and public workspace exposes enabled configuration", async () => {
await prisma.inquirySubmission.deleteMany({ where: { brandId } });
await prisma.inquiryForm.deleteMany({ where: { brandId } });