feat: 支持后台配置动态咨询表单
This commit is contained in:
1 parent
aee1cff5a3
commit
54bf385f68
5 files changed
+118
-7
No files matched your search
@@ -459,6 +459,26 @@ test("admin can create and version an inquiry form", async () => {
|
||||
assert.equal(created.statusCode, 201);
|
||||
const id = JSON.parse(created.body).id;
|
||||
try {
|
||||
const disabledForm = await request(`/admin/workspace/forms/${id}`, {
|
||||
method: "PATCH",
|
||||
headers: { authorization: `Bearer ${token}` },
|
||||
payload: { isEnabled: false },
|
||||
});
|
||||
assert.equal(disabledForm.statusCode, 200);
|
||||
assert.equal(JSON.parse(disabledForm.body).isEnabled, false);
|
||||
assert.equal((await request(`/public/inquiry-forms/${id}`)).statusCode, 400);
|
||||
const blockedDisabledForm = await request("/customer/inquiry-submissions", {
|
||||
method: "POST",
|
||||
headers: { authorization: `Bearer ${customerToken}` },
|
||||
payload: { formId: id, values: { budget: 1000 } },
|
||||
});
|
||||
assert.equal(blockedDisabledForm.statusCode, 400);
|
||||
const enabledForm = await request(`/admin/workspace/forms/${id}`, {
|
||||
method: "PATCH",
|
||||
headers: { authorization: `Bearer ${token}` },
|
||||
payload: { isEnabled: true },
|
||||
});
|
||||
assert.equal(enabledForm.statusCode, 200);
|
||||
const updated = await request(`/admin/workspace/forms/${id}`, {
|
||||
method: "PATCH",
|
||||
headers: { authorization: `Bearer ${token}` },
|
||||
|
||||
Reference in new issue
Block a user