Fix duplicate project worktree registration (#1024)
* Fix duplicate project worktree registration * Update archive redirect test for project-aware routes
This commit is contained in:
@@ -47,7 +47,7 @@ describe("buildWorkspaceArchiveRedirectRoute", () => {
|
||||
archivedWorkspaceId: "/repo/.paseo/worktrees/feature",
|
||||
workspaces,
|
||||
}),
|
||||
).toBe("/h/server-1/new?dir=%2Frepo&name=Project");
|
||||
).toBe("/h/server-1/new?dir=%2Frepo&name=Project&projectId=project-1");
|
||||
});
|
||||
|
||||
it("redirects to the new workspace route when no sibling workspace target exists", () => {
|
||||
@@ -65,7 +65,7 @@ describe("buildWorkspaceArchiveRedirectRoute", () => {
|
||||
archivedWorkspaceId: "/repo/.paseo/worktrees/feature",
|
||||
workspaces,
|
||||
}),
|
||||
).toBe("/h/server-1/new?dir=%2Frepo&name=Project");
|
||||
).toBe("/h/server-1/new?dir=%2Frepo&name=Project&projectId=project-1");
|
||||
});
|
||||
|
||||
it("redirects to the new workspace route instead of another workspace", () => {
|
||||
@@ -85,7 +85,7 @@ describe("buildWorkspaceArchiveRedirectRoute", () => {
|
||||
archivedWorkspaceId: "/notes",
|
||||
workspaces,
|
||||
}),
|
||||
).toBe("/h/server-1/new?dir=%2Fnotes&name=Project");
|
||||
).toBe("/h/server-1/new?dir=%2Fnotes&name=Project&projectId=notes");
|
||||
});
|
||||
});
|
||||
|
||||
@@ -132,6 +132,8 @@ describe("redirectIfArchivingActiveWorkspace", () => {
|
||||
}),
|
||||
).toBe(true);
|
||||
|
||||
expect(replaceMock).toHaveBeenCalledWith("/h/server-1/new?dir=%2Frepo&name=Project");
|
||||
expect(replaceMock).toHaveBeenCalledWith(
|
||||
"/h/server-1/new?dir=%2Frepo&name=Project&projectId=project-1",
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user