feat: 增加扩展配置校验器
This commit is contained in:
1 parent
29d14378a7
commit
8baa042255
7 files changed
+85
-32
No files matched your search
@@ -247,6 +247,16 @@ test("admin can manage offerings and public endpoint hides disabled offerings",
|
||||
payload: { username: "admin", password: process.env.SEED_ADMIN_PASSWORD },
|
||||
});
|
||||
const token = JSON.parse(login.body).token;
|
||||
const invalidConfig = await request("/admin/workspace/offerings", {
|
||||
method: "POST",
|
||||
headers: { authorization: `Bearer ${token}` },
|
||||
payload: {
|
||||
kind: "product",
|
||||
name: `无效配置-${Date.now()}`,
|
||||
config: { sections: "必须是数组" },
|
||||
},
|
||||
});
|
||||
assert.equal(invalidConfig.statusCode, 400);
|
||||
const created = await request("/admin/workspace/offerings", {
|
||||
method: "POST",
|
||||
headers: { authorization: `Bearer ${token}` },
|
||||
|
||||
Reference in new issue
Block a user