import { describe, expect, it } from "vitest"; import { kindLabel, reasonLabel } from "./injection"; describe("reasonLabel", () => { it("maps each known selection reason to a Chinese badge", () => { expect(reasonLabel("explicit_beat")).toBe("本章点名"); expect(reasonLabel("main_character")).toBe("主角常驻"); expect(reasonLabel("recent_digest")).toBe("近章出现"); expect(reasonLabel("foreshadow_window")).toBe("伏笔窗口"); }); it("falls back to the raw code for an unknown reason", () => { expect(reasonLabel("future_reason")).toBe("future_reason"); }); }); describe("kindLabel", () => { it("maps entity kinds to Chinese", () => { expect(kindLabel("character")).toBe("角色"); expect(kindLabel("world_entity")).toBe("设定"); }); it("falls back to the raw kind when unknown", () => { expect(kindLabel("mystery")).toBe("mystery"); }); });