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.
25 lines
812 B
25 lines
812 B
import { describe, expect, it } from "vitest";
|
|
import { classifyMail } from "@/services/parse/classify";
|
|
import { shouldForceForecastUnit } from "@/services/parse/resolve-confirm-instruction";
|
|
|
|
describe("classify — 主题预报+整表附件", () => {
|
|
it("classifies subject 预报 + 测试AI建单.xlsx as NEW_CONTAINER", () => {
|
|
const ev = classifyMail({
|
|
subject: "预报",
|
|
body: "",
|
|
filenames: ["测试AI建单.xlsx"],
|
|
});
|
|
expect(ev.mail_type).toBe("NEW_CONTAINER");
|
|
expect(ev.scores.NEW_CONTAINER).toBeGreaterThanOrEqual(40);
|
|
});
|
|
|
|
it("forces forecast unit for attachment-only 预报 mail", () => {
|
|
expect(
|
|
shouldForceForecastUnit({
|
|
subject: "预报",
|
|
attachments: [{ filename: "测试AI建单.xlsx" }],
|
|
}),
|
|
).toBe(true);
|
|
});
|
|
});
|