mirror of
https://github.com/harivansh-afk/sandbox-agent.git
synced 2026-04-20 10:01:28 +00:00
chore: recover bogota workspace state
This commit is contained in:
parent
5d65013aa5
commit
e08d1b4dca
436 changed files with 172093 additions and 455 deletions
38
factory/packages/frontend/src/lib/workbench.test.ts
Normal file
38
factory/packages/frontend/src/lib/workbench.test.ts
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
import { describe, expect, it } from "vitest";
|
||||
import type { HandoffWorkbenchSnapshot } from "@sandbox-agent/factory-shared";
|
||||
import { resolveRepoRouteHandoffId } from "./workbench-routing";
|
||||
|
||||
const snapshot: HandoffWorkbenchSnapshot = {
|
||||
workspaceId: "default",
|
||||
repos: [
|
||||
{ id: "repo-a", label: "acme/repo-a" },
|
||||
{ id: "repo-b", label: "acme/repo-b" },
|
||||
],
|
||||
projects: [],
|
||||
handoffs: [
|
||||
{
|
||||
id: "handoff-a",
|
||||
repoId: "repo-a",
|
||||
title: "Alpha",
|
||||
status: "idle",
|
||||
repoName: "acme/repo-a",
|
||||
updatedAtMs: 20,
|
||||
branch: "feature/alpha",
|
||||
pullRequest: null,
|
||||
tabs: [],
|
||||
fileChanges: [],
|
||||
diffs: {},
|
||||
fileTree: [],
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
describe("resolveRepoRouteHandoffId", () => {
|
||||
it("finds the active handoff for a repo route", () => {
|
||||
expect(resolveRepoRouteHandoffId(snapshot, "repo-a")).toBe("handoff-a");
|
||||
});
|
||||
|
||||
it("returns null when a repo has no handoff yet", () => {
|
||||
expect(resolveRepoRouteHandoffId(snapshot, "repo-b")).toBeNull();
|
||||
});
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue