Files
openidea/src/platform/windowGroups.test.ts
T
l0ng-ai 01defdefe4 feat: multi-project workspaces and project window groups (#448)
Workspaces open several local project folders in one IDE session (File › New / Open / Manage Workspace…, or Attach when opening a project, which creates a workspace automatically for a plain project window). Member folders are the Project view roots and take part in indexing, Find in Files, Git, language servers, run configurations and builds; agent tasks choose which member they work in. Window › Merge All Project Windows groups project windows into one window with project tabs (switch, reorder, close, move to a new window), restored on reopen.

Closes #241
Closes #198
Closes #286
2026-10-30 22:45:42 +08:00

17 lines
828 B
TypeScript

import { describe, expect, it } from "vitest";
import { reorderedTabs } from "./windowGroups";
describe("project window order", () => {
const tabs = ["a", "b", "c"].map((label) => ({ label, name: label, current: label === "b", root: `/${label}` }));
it("moves a tab across its neighbours without changing the source or active window", () => {
expect(reorderedTabs(tabs, "a", "c")).toEqual(["b", "c", "a"]);
expect(reorderedTabs(tabs, "c", "a")).toEqual(["c", "a", "b"]);
expect(tabs.map((t) => t.label)).toEqual(["a", "b", "c"]);
expect(tabs.find((t) => t.current)?.label).toBe("b");
});
it("ignores external drags and missing targets", () => {
expect(reorderedTabs(tabs, "outside", "b")).toEqual(["a", "b", "c"]);
expect(reorderedTabs(tabs, "a", "outside")).toEqual(["a", "b", "c"]);
});
});