修改未完成
This commit is contained in:
@@ -78,7 +78,7 @@ const run = async () => {
|
||||
toDataModuleUrl(`${prelude}\n${moduleBody}`),
|
||||
);
|
||||
const submit = (payload = {
|
||||
feedbackType: "功能问题",
|
||||
feedbackType: "bug",
|
||||
feedbackContent: "上传照片时出现异常",
|
||||
contactInfo: "user@example.com",
|
||||
}) => appApi.submitFeedback(payload);
|
||||
@@ -90,11 +90,12 @@ const run = async () => {
|
||||
{ feedbackContent: " " },
|
||||
{ feedbackContent: 123 },
|
||||
{ feedbackContent: "内容", feedbackType: 1 },
|
||||
{ feedbackContent: "内容", feedbackType: "feature" },
|
||||
{ feedbackContent: "内容", contactInfo: false },
|
||||
{ feedbackContent: "内容", type: "旧字段" },
|
||||
Object.assign(Object.create({ feedbackType: "继承字段" }), { feedbackContent: "内容" }),
|
||||
]) {
|
||||
await assert.rejects(submit(invalid), /反馈|字段|对象|字符串/);
|
||||
await assert.rejects(submit(invalid), /反馈|字段|对象|字符串|feedbackType/);
|
||||
}
|
||||
|
||||
nextResponse = { statusCode: 200, data: { code: 200, msg: "成功", data: { accepted: true } } };
|
||||
@@ -103,11 +104,11 @@ const run = async () => {
|
||||
assert.deepStrictEqual(requests.at(-1).data, { feedbackContent: "仅反馈内容" });
|
||||
|
||||
nextResponse = { statusCode: 200, data: { code: 200, msg: "成功", data: { feedbackId: 1 } } };
|
||||
const result = await submit({ feedbackContent: " 有效反馈 ", feedbackType: " 使用建议 ", contactInfo: " " });
|
||||
const result = await submit({ feedbackContent: " 有效反馈 ", feedbackType: " advice ", contactInfo: " " });
|
||||
assert.deepStrictEqual(result, { feedbackId: 1 });
|
||||
assert.deepStrictEqual(requests.at(-1).data, {
|
||||
feedbackContent: "有效反馈",
|
||||
feedbackType: "使用建议",
|
||||
feedbackType: "advice",
|
||||
});
|
||||
assert.strictEqual(requests.at(-1).url, "https://backend-api.ddxcjp.cn/genealogy/app/feedback");
|
||||
assert.strictEqual(requests.at(-1).method, "POST");
|
||||
|
||||
Reference in New Issue
Block a user