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.
23 lines
863 B
23 lines
863 B
import { describe, expect, it } from "vitest";
|
|
import {
|
|
scrubProviderBrandForCustomer,
|
|
scrubProviderCarrierLabel,
|
|
} from "@/lib/frontend/scrub-provider-brand";
|
|
|
|
describe("scrubProviderBrandForCustomer", () => {
|
|
it("替换尺寸超限文案中的品牌", () => {
|
|
expect(scrubProviderBrandForCustomer("尺寸超出 Mothership 允许范围")).toBe(
|
|
"尺寸超出 承运商 允许范围",
|
|
);
|
|
expect(
|
|
scrubProviderBrandForCustomer("MotherShip 要求整数:已向上取整"),
|
|
).toBe("承运商 要求整数:已向上取整");
|
|
});
|
|
|
|
it("承运商名整段命中时改为平台承运", () => {
|
|
expect(scrubProviderCarrierLabel("MotherShip")).toBe("平台承运");
|
|
expect(scrubProviderCarrierLabel("Mothership")).toBe("平台承运");
|
|
expect(scrubProviderCarrierLabel("TForce Direct")).toBe("TForce Direct");
|
|
});
|
|
});
|