refactor: 拆分品牌业务类型与页面方案
CI / Static checks (push) Has been cancelled
CI / Production build (push) Has been cancelled
CI / API integration (push) Has been cancelled
CI / Taro builds (acheng-campus-food) (push) Has been cancelled
CI / Taro builds (atelier-solopreneur) (push) Has been cancelled
CI / Taro builds (linjing-editorial) (push) Has been cancelled
CI / Browser regression (push) Has been cancelled

This commit is contained in:
que01 committed 2026-10-20 17:04:30 +08:00
1 parent f02e2cafbb
commit 0d9f4a7d6f
86 files changed
+4111 -1543

No files matched your search

+35 -1
View File
@@ -101,6 +101,40 @@ test("品牌切换客户端不再接收 token", async () => {
]);
});
test("创建品牌与品牌内页面方案选项使用各自授权接口", async () => {
const calls: Array<{ url: string; method?: string; body?: string }> = [];
const client = new ApiClient({
baseUrl: "http://api.test",
token: "owner-token",
fetcher: async (url, init) => {
calls.push({ url, method: init?.method, body: init?.body });
return response({});
},
});
await client.getAdminBrandCreationOptions();
await client.createAdminBrand({
name: "林境门窗",
slug: "linjing-windows",
businessType: "doors",
templatePackageVersionId: "version-1",
});
await client.getAdminPageSchemeOptions();
assert.deepEqual(calls, [
{ url: "http://api.test/admin/brands/creation-options", method: "GET", body: undefined },
{
url: "http://api.test/admin/brands",
method: "POST",
body: JSON.stringify({
name: "林境门窗",
slug: "linjing-windows",
businessType: "doors",
templatePackageVersionId: "version-1",
}),
},
{ url: "http://api.test/admin/workspace/template/options", method: "GET", body: undefined },
]);
});
test("客户端将统一错误响应转换为 ApiClientError", async () => {
const client = new ApiClient({
baseUrl: "http://api.test",
@@ -206,7 +240,7 @@ test("模板目录客户端发送分页并支持版本发布和审计", async ()
]);
});
test("模板升级和回滚提交预览版本、checksum 与逐项保留确认", async () => {
test("模板升级和回滚提交预览版本、checksum 与全部保留确认", async () => {
const calls: Array<{ url: string; method?: string; body?: string }> = [];
const client = new ApiClient({
baseUrl: "http://api.test",