test: 验证视觉模板运行时切换
This commit is contained in:
1 parent
4a6cd3adc6
commit
facf261bd6
2 files changed
+32
No files matched your search
@@ -203,6 +203,37 @@ test("admin can customize workspace modules and fields with brand isolation", as
|
||||
}
|
||||
});
|
||||
|
||||
test("admin visual template selection is reflected in public runtime workspace", async () => {
|
||||
const login = await request("/admin/session/login", {
|
||||
method: "POST",
|
||||
payload: { username: "admin", password: process.env.SEED_ADMIN_PASSWORD },
|
||||
});
|
||||
const token = JSON.parse(login.body).token;
|
||||
const before = await request("/public/workspace");
|
||||
assert.equal(before.statusCode, 200);
|
||||
const updated = await request("/admin/config/brand", {
|
||||
method: "PATCH",
|
||||
headers: { authorization: `Bearer ${token}` },
|
||||
payload: { config: { visualTemplateKey: "minimal-neutral" } },
|
||||
});
|
||||
assert.equal(updated.statusCode, 200);
|
||||
try {
|
||||
const runtime = await request("/public/workspace");
|
||||
assert.equal(runtime.statusCode, 200);
|
||||
const body = JSON.parse(runtime.body);
|
||||
assert.equal(body.visualTemplate.key, "minimal-neutral");
|
||||
assert.equal(body.visualTemplate.version, "1.0.0");
|
||||
assert.equal(body.theme.colors.accent, "#4B5563");
|
||||
assert.equal(body.visualTemplate.variants.hero, "minimal");
|
||||
} finally {
|
||||
await request("/admin/config/brand", {
|
||||
method: "PATCH",
|
||||
headers: { authorization: `Bearer ${token}` },
|
||||
payload: { config: JSON.parse(before.body).brand?.config ?? {} },
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
test("admin can create and version an inquiry form", async () => {
|
||||
const login = await request("/admin/session/login", {
|
||||
method: "POST",
|
||||
|
||||
@@ -44,6 +44,7 @@
|
||||
- [x] 建立行业模板与视觉模板注册表,并注册林境建筑画册与极简留白视觉模板。
|
||||
- [x] Runtime Workspace 合并品牌配置中的视觉模板主题、版本和模块变体。
|
||||
- [x] Admin 工作空间支持切换视觉模板并保存 `visualTemplateKey`。
|
||||
- [x] 集成测试验证视觉模板切换会影响公开 Runtime Workspace 的主题和变体。
|
||||
- [ ] Phase 4:Capability Plugin。
|
||||
- [ ] Phase 5:林境门作与第二行业双模板验证。
|
||||
- [ ] Phase 6:Stitch 到 Manifest 的转换流水线。
|
||||
|
||||
Reference in new issue
Block a user