mentionPanelRouting.test.ts 1004 B

123456789101112131415161718192021222324252627282930
  1. import { describe, expect, it } from "vitest";
  2. import {
  3. getMentionPanelGroupOrder,
  4. getSessionMentionWorkspaceScope,
  5. } from "../src/mentions/mentionPanelRouting.js";
  6. describe("getMentionPanelGroupOrder", () => {
  7. it("routes @ through the fixed context group order", () => {
  8. expect(getMentionPanelGroupOrder("@")).toEqual([
  9. "plugins",
  10. "files",
  11. "sessions",
  12. "whiteboards",
  13. ]);
  14. });
  15. it("keeps the legacy # and $ candidate panels", () => {
  16. expect(getMentionPanelGroupOrder("#")).toEqual(["sessions"]);
  17. expect(getMentionPanelGroupOrder("$")).toEqual(["skills"]);
  18. });
  19. it("只让 # 扩展对话 workspace 范围", () => {
  20. expect(getSessionMentionWorkspaceScope("#")).toBe(
  21. "same-authority-workspaces",
  22. );
  23. expect(getSessionMentionWorkspaceScope("@")).toBe("current-workspace");
  24. expect(getSessionMentionWorkspaceScope("$")).toBe("current-workspace");
  25. expect(getSessionMentionWorkspaceScope(null)).toBe("current-workspace");
  26. });
  27. });