This commit is contained in:
Nathan Flurry 2026-03-14 20:28:41 -07:00
parent 3263d4f5e1
commit 0fbea6ce61
166 changed files with 6675 additions and 7105 deletions

View file

@ -3,14 +3,14 @@ import type { TaskRecord } from "@sandbox-agent/foundry-shared";
import { filterTasks, formatRelativeAge, fuzzyMatch, summarizeTasks } from "../src/view-model.js";
const sample: TaskRecord = {
workspaceId: "default",
organizationId: "default",
repoId: "repo-a",
repoRemote: "https://example.com/repo-a.git",
taskId: "task-1",
branchName: "feature/test",
title: "Test Title",
task: "Do test",
providerId: "local",
sandboxProviderId: "local",
status: "running",
statusMessage: null,
activeSandboxId: "sandbox-1",
@ -18,7 +18,7 @@ const sample: TaskRecord = {
sandboxes: [
{
sandboxId: "sandbox-1",
providerId: "local",
sandboxProviderId: "local",
sandboxActorId: null,
switchTarget: "sandbox://local/sandbox-1",
cwd: null,
@ -59,7 +59,7 @@ describe("search helpers", () => {
},
];
expect(filterTasks(rows, "doc")).toHaveLength(1);
expect(filterTasks(rows, "h2")).toHaveLength(1);
expect(filterTasks(rows, "intro")).toHaveLength(1);
expect(filterTasks(rows, "test")).toHaveLength(2);
});
});
@ -73,8 +73,8 @@ describe("summary helpers", () => {
it("summarizes by status and provider", () => {
const rows: TaskRecord[] = [
sample,
{ ...sample, taskId: "task-2", status: "idle", providerId: "local" },
{ ...sample, taskId: "task-3", status: "error", providerId: "local" },
{ ...sample, taskId: "task-2", status: "idle", sandboxProviderId: "local" },
{ ...sample, taskId: "task-3", status: "error", sandboxProviderId: "local" },
];
const summary = summarizeTasks(rows);