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

29 lines
1.2 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import { test, expect, describe } from "bun:test";
import { rdMeegoContacts } from "../src/meego";
// 任务 f881ef9a:RD 把 Meego 单流转到 RESOLVED 后,经办人 / 当前负责人都交回给提单 QA,
// 复核打回再跑的那几轮 commit 记到了 QA 名下。交回之后经办人不再算 RD。
describe("rdMeegoContacts", () => {
const c = (state: string | null) => ({ assignee: "qa@x.com", assignees: ["qa@x.com"], reporter: "qa@x.com", state });
test("还在修:经办人原样保留", () => {
for (const s of ["OPEN", "IN PROGRESS", "REOPENED", null]) {
expect(rdMeegoContacts(c(s)).assignee).toBe("qa@x.com");
expect(rdMeegoContacts(c(s)).assignees).toEqual(["qa@x.com"]);
}
});
test("RESOLVED / DONE / CLOSED:清空经办人,reporter 不动", () => {
for (const s of ["RESOLVED", "resolved", "DONE", "closed"]) {
const r = rdMeegoContacts(c(s));
expect(r.assignee).toBeNull();
expect(r.assignees).toEqual([]);
expect(r.reporter).toBe("qa@x.com");
}
});
test("没有 state 字段(查询失败的兜底对象)也能用", () => {
expect(rdMeegoContacts({ assignee: null, reporter: null })).toEqual({ assignee: null, reporter: null });
});
});