Open the complete working comparison in a desktop workspace tab while preserving inline sidebar diffs when the tab is closed. Working and commit comparisons share one diff panel, and workspace layout is the sole owner of live tab persistence and identity. Refs #1520
19 lines
671 B
TypeScript
19 lines
671 B
TypeScript
import { describe, expect, it } from "vitest";
|
|
import { buildWorkspaceTabPersistenceKey } from "./model";
|
|
|
|
describe("buildWorkspaceTabPersistenceKey", () => {
|
|
it("trims and joins opaque server and workspace ids", () => {
|
|
expect(
|
|
buildWorkspaceTabPersistenceKey({
|
|
serverId: " server-1 ",
|
|
workspaceId: " setup\\workspace\\ ",
|
|
}),
|
|
).toBe("server-1:setup\\workspace\\");
|
|
});
|
|
|
|
it("rejects incomplete identities", () => {
|
|
expect(buildWorkspaceTabPersistenceKey({ serverId: "", workspaceId: "workspace" })).toBeNull();
|
|
expect(buildWorkspaceTabPersistenceKey({ serverId: "server", workspaceId: " " })).toBeNull();
|
|
});
|
|
});
|