29 lines
1.1 KiB
TypeScript
29 lines
1.1 KiB
TypeScript
import { describe, expect, it } from "vitest";
|
|
import {
|
|
getOrderUpdateForInboundAction,
|
|
getOrderUpdateForOutboundDispatch,
|
|
} from "./workflow";
|
|
|
|
describe("chatbot workflow mapping", () => {
|
|
it("maps confirm delivery to agreed delivery statuses", () => {
|
|
expect(getOrderUpdateForInboundAction("confirm_delivery")).toEqual({
|
|
status: "Доставка согласована",
|
|
deliveryAgreementStatus: "Подтверждено клиентом",
|
|
});
|
|
});
|
|
|
|
it("maps reschedule request to waiting coordination statuses", () => {
|
|
expect(getOrderUpdateForInboundAction("reschedule")).toEqual({
|
|
status: "Ожидает согласования доставки",
|
|
deliveryAgreementStatus: "Перенос запрошен",
|
|
});
|
|
});
|
|
|
|
it("marks outbound delivery offer as sent to client", () => {
|
|
expect(getOrderUpdateForOutboundDispatch("send_delivery_offer")).toEqual({
|
|
status: "Ожидает согласования доставки",
|
|
deliveryAgreementStatus: "Отправлено клиенту",
|
|
});
|
|
});
|
|
});
|