test: 固化动态咨询运行时验收

This commit is contained in:
que01 committed 2026-09-23 09:48:17 +08:00
1 parent 6d2c12c3df
commit aee1cff5a3
5 files changed
+68 -1

No files matched your search

+13 -1
View File
@@ -463,7 +463,15 @@ test("admin can create and version an inquiry form", async () => {
method: "PATCH",
headers: { authorization: `Bearer ${token}` },
payload: {
fieldsSnapshot: [{ key: "budget", type: "number", label: "预算", required: true }],
fieldsSnapshot: [
{ key: "budget", type: "number", label: "预算", required: true },
{
key: "contactMethod",
type: "select",
label: "联系渠道",
options: [{ label: "微信", value: "wechat" }],
},
],
},
});
assert.equal(updated.statusCode, 200);
@@ -511,6 +519,10 @@ test("admin can create and version an inquiry form", async () => {
(form) => form.key === id && form.targetId === offering.id,
),
);
const runtimeForm = JSON.parse(publicWorkspace.body).inquiryForms.find(
(form) => form.key === id,
);
assert.deepEqual(runtimeForm.fields[1].options, [{ label: "微信", value: "wechat" }]);
const submission = await request("/customer/inquiry-submissions", {
method: "POST",
headers: { authorization: `Bearer ${customerToken}` },