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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user