Files
streamline/control-server/test/import_watchers.test.ts
T
2026-11-16 17:26:44 -08:00

19 lines
1.0 KiB
TypeScript

import "./setup_env";
import { test, expect, describe } from "bun:test";
import { seedWatcherKeys } from "../src/importer";
describe("建单时的关注人", () => {
const creator = { email: "jingyuan.yi@bytedance.com", larkId: "ou_x", extraWatchers: ["oc_group"] };
test("单条导入:导入人 → 经办人 → 额外", () => {
expect(seedWatcherKeys(creator, "wusong.1228@bytedance.com"))
.toEqual(["jingyuan.yi@bytedance.com", "ou_x", "wusong.1228@bytedance.com", "oc_group"]);
});
test("批量导入:不放导入人,经办人照常进", () => {
expect(seedWatcherKeys({ ...creator, batch: true }, "wusong.1228@bytedance.com"))
.toEqual(["wusong.1228@bytedance.com", "oc_group"]);
});
test("增量托管:和批量导入一样,经办人照常进、导入人不放(托管期间的卡在 notify.ts 拦)", () => {
expect(seedWatcherKeys({ ...creator, hosted: "photo_mode_mobile" }, "wusong.1228@bytedance.com")).toEqual(["wusong.1228@bytedance.com", "oc_group"]);
});
});