import { describe, expect, it } from "vitest"; import { aiToolItems } from "./ai-tools"; describe("aiToolItems", () => { it("returns 5 items", () => { expect(aiToolItems("p1")).toHaveLength(5); }); it("leads with 写本章 (primary, key write)", () => { const [first] = aiToolItems("p1"); expect(first.label).toBe("写本章"); expect(first.primary).toBe(true); expect(first.key).toBe("write"); }); it("scopes every href under the project path", () => { for (const item of aiToolItems("abc")) { expect(item.href.startsWith("/projects/abc/")).toBe(true); } }); it("maps 审稿 to the review page and key", () => { const review = aiToolItems("p1").find((item) => item.label === "审稿"); expect(review?.href).toBe("/projects/p1/review"); expect(review?.key).toBe("review"); }); });