feat: 收口多品牌与模板构建基础

This commit is contained in:
que01 committed 2026-09-25 02:55:46 +08:00
1 parent 0425a1c672
commit 77224ea51f
317 files changed
+11290 -1158

No files matched your search

+22
View File
@@ -47,3 +47,25 @@ test("客户端将统一错误响应转换为 ApiClientError", async () => {
},
);
});
test("发布检查与发布操作使用当前品牌的管理接口", async () => {
const calls: Array<{ url: string; method?: string; body?: string }> = [];
const client = new ApiClient({
baseUrl: "http://api.test",
token: "brand-token",
fetcher: async (url, init) => {
calls.push({ url, method: init?.method, body: init?.body });
return response({ ready: true, checks: [] });
},
});
await client.getAdminReleaseReadiness();
await client.publishAdminRelease("首次发布");
assert.deepEqual(calls, [
{ url: "http://api.test/admin/releases/readiness", method: "GET", body: undefined },
{
url: "http://api.test/admin/releases/publish",
method: "POST",
body: JSON.stringify({ note: "首次发布" }),
},
]);
});