Files
writing-agent/tests/display-labels.test.ts
moran 6392af54b4 完善配方驱动的创作编排
为可重复技能补充参数校验与展示,统一配方、编排器和执行单元术语。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-30 17:59:20 +08:00

31 lines
1.1 KiB
TypeScript

import { describe, expect, it } from "vitest";
import {
displayStageLabel,
displayWorkerLabel,
formatWorkerDisplayTitle,
} from "../src/server/display-labels.js";
describe("display-labels", () => {
it("maps lifecycle stages", () => {
expect(displayStageLabel("design")).toBe("创作");
expect(displayStageLabel("play")).toBe("游玩");
});
it("maps design workers", () => {
expect(displayWorkerLabel("design-flow")).toBe("创作 · 流程编排");
expect(displayWorkerLabel("design-step")).toBe("创作 · 执行步骤");
expect(formatWorkerDisplayTitle("design-flow", "output")).toBe(
"创作 · 流程编排 · 产出",
);
});
it("maps creation unit ids", () => {
expect(displayWorkerLabel("phase:core")).toBe("单位 · 核心");
expect(displayWorkerLabel("fixed:interaction")).toBe("技能 · 交互范式");
expect(displayWorkerLabel("fixed:aesthetics-interaction")).toBe(
"技能 · 美学纲领与交互范式",
);
expect(displayWorkerLabel("worker:narrator")).toBe("执行单元 · 叙事转述");
});
});