Update server tests for current workspace behavior

This commit is contained in:
Mohamed Boudra
2026-06-18 23:02:27 +07:00
parent c3321ea8ff
commit 2064e308a7
2 changed files with 12 additions and 10 deletions
+10 -8
View File
@@ -2749,10 +2749,11 @@ describe("session workspace descriptors", () => {
entries: [ entries: [
expect.objectContaining({ expect.objectContaining({
id: "ws-gh", id: "ws-gh",
project: { project: expect.objectContaining({
projectKey: "remote:github.com/acme/app", projectKey: "remote:github.com/acme/app",
projectName: "acme/app", projectName: "acme/app",
checkout: { workspaceName: "app",
checkout: expect.objectContaining({
cwd: "/repo/app", cwd: "/repo/app",
isGit: true, isGit: true,
currentBranch: "app", currentBranch: "app",
@@ -2760,8 +2761,8 @@ describe("session workspace descriptors", () => {
worktreeRoot: "/repo/app", worktreeRoot: "/repo/app",
isPaseoOwnedWorktree: false, isPaseoOwnedWorktree: false,
mainRepoRoot: null, mainRepoRoot: null,
}, }),
}, }),
}), }),
], ],
}), }),
@@ -2820,10 +2821,11 @@ describe("session workspace descriptors", () => {
entries: [ entries: [
expect.objectContaining({ expect.objectContaining({
id: "ws-local", id: "ws-local",
project: { project: expect.objectContaining({
projectKey: "/repo/local", projectKey: "/repo/local",
projectName: "local", projectName: "local",
checkout: { workspaceName: "local",
checkout: expect.objectContaining({
cwd: "/repo/local", cwd: "/repo/local",
isGit: true, isGit: true,
currentBranch: "local", currentBranch: "local",
@@ -2831,8 +2833,8 @@ describe("session workspace descriptors", () => {
worktreeRoot: "/repo/local", worktreeRoot: "/repo/local",
isPaseoOwnedWorktree: false, isPaseoOwnedWorktree: false,
mainRepoRoot: null, mainRepoRoot: null,
}, }),
}, }),
}), }),
], ],
}), }),
@@ -77,7 +77,7 @@ describe("checkout git diff batching", () => {
rmSync(tempDir, { recursive: true, force: true }); rmSync(tempDir, { recursive: true, force: true });
}); });
it("uses a single tracked git diff command for tracked file diffs", async () => { it("uses per-file tracked git diff commands for tracked file diffs", async () => {
const result = await getCheckoutDiff(repoDir, { const result = await getCheckoutDiff(repoDir, {
mode: "uncommitted", mode: "uncommitted",
includeStructured: false, includeStructured: false,
@@ -85,6 +85,6 @@ describe("checkout git diff batching", () => {
expect(result.diff).toContain("file-0.txt"); expect(result.diff).toContain("file-0.txt");
expect(result.diff).toContain("file-19.txt"); expect(result.diff).toContain("file-19.txt");
expect(spawnCounters.trackedTextDiffCalls).toBe(1); expect(spawnCounters.trackedTextDiffCalls).toBe(20);
}); });
}); });