Add a global New workspace picker (#1324)
* Add global New workspace project picker * Clean up New workspace picker state
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import {
|
||||
buildHostAgentDetailRoute,
|
||||
buildHostNewWorkspaceRoute,
|
||||
buildHostRootRoute,
|
||||
buildHostWorkspaceOpenRoute,
|
||||
buildHostWorkspaceRoute,
|
||||
@@ -120,6 +121,19 @@ describe("workspace route parsing", () => {
|
||||
);
|
||||
});
|
||||
|
||||
it("builds a global new workspace route without a source directory", () => {
|
||||
expect(buildHostNewWorkspaceRoute("local")).toBe("/h/local/new");
|
||||
});
|
||||
|
||||
it("builds a project shortcut new workspace route with initial project context", () => {
|
||||
expect(
|
||||
buildHostNewWorkspaceRoute("local", "/repo/project", {
|
||||
displayName: "Project",
|
||||
projectId: "project-1",
|
||||
}),
|
||||
).toBe("/h/local/new?dir=%2Frepo%2Fproject&name=Project&projectId=project-1");
|
||||
});
|
||||
|
||||
it("round-trips URL-safe IDs through encode/decode", () => {
|
||||
const ids = ["1", "40", "164", "9999", "workspace-1", "opaque_id.v2~test"];
|
||||
for (const id of ids) {
|
||||
|
||||
Reference in New Issue
Block a user