You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
mail-yubao/tests/unit/cc-customer-message-entity....

29 lines
1.1 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

import { describe, expect, it } from "vitest";
import { buildCcWorkOrderFormValue } from "@/components/CcWorkOrderForm";
import { toCcCustomerMessageEntity } from "@/services/cc/customer-message-entity";
describe("admin SRCustomerMessage → SaveForm entity", () => {
it("passes 客户/紧急程度/留言类型/指令正文 to SaveForm", () => {
const form = buildCcWorkOrderFormValue({
subject: "换标操作指令",
body: "Dear,\n原箱号 YT1 覆盖贴FBA标签,贴好拍照回传",
containerNo: "WHSU8127240",
customerName: "新辰泽",
});
expect(form.F_MessageType).toBe("操作指令");
expect(form.F_CustomerName).toBe("新辰泽");
expect(form.F_UrgencyLevel).toBe("0");
expect(form.F_MessageContent).toContain("覆盖贴");
const entity = toCcCustomerMessageEntity(form);
expect(entity).toMatchObject({
F_ReferCode: "WHSU8127240",
F_MessageType: "操作指令",
F_CustomerName: "新辰泽",
F_UrgencyLevel: "0",
});
expect(entity.F_MessageContent).toContain("覆盖贴");
expect(entity).not.toHaveProperty("mailActions");
});
});