test(dashboard): add getProject mock to node-routes CentralCore mock

The PATCH /api/projects/:id route handler now reads central.getProject
before attempting updates/assignments. The CentralCore mock in
node-routes.test.ts didn't include that method, so the route threw and
returned 500 instead of 200. Add the stub.

Fixes 2 failing tests in node-routes.test.ts (assigns/unassigns nodeId
PATCH cases).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
gsxdsm
2026-05-19 19:04:46 -07:00
parent 294f719ae3
commit 32b1fbd869

View File

@@ -36,6 +36,15 @@ vi.mock("@fusion/core", async () => {
unregisterNode: mockUnregisterNode,
checkNodeHealth: mockCheckNodeHealth,
updateProject: mockUpdateProject,
getProject: vi.fn(async (id: string) => ({
id,
name: "Project",
path: "/tmp/project",
status: "active",
isolationMode: "in-process",
createdAt: "2026-01-01T00:00:00.000Z",
updatedAt: "2026-01-01T00:00:00.000Z",
})),
assignProjectToNode: mockAssignProjectToNode,
unassignProjectFromNode: mockUnassignProjectFromNode,
getLocalMeshSnapshot: mockGetLocalMeshSnapshot,