refactor(api): extract computation graph project snapshot
This commit is contained in:
@@ -315,4 +315,24 @@ describe("computation graph router", () => {
|
||||
expect(result.nodes.every((node) => node.domain === "BUDGET")).toBe(true);
|
||||
expect(result.links?.length).toBe(result.selectedLinkCount);
|
||||
});
|
||||
|
||||
it("returns the project snapshot graph through the base router contract", async () => {
|
||||
const db = createProjectDb(vi.fn().mockResolvedValue(buildProject()));
|
||||
|
||||
const caller = createControllerCaller(db);
|
||||
const result = await caller.getProjectData({
|
||||
projectId: "project_1",
|
||||
});
|
||||
|
||||
expect(result.meta).toEqual({
|
||||
projectName: "Gelddruckmaschine",
|
||||
projectCode: "GDM",
|
||||
});
|
||||
expect(result.nodes.map((node) => node.id)).toEqual(expect.arrayContaining([
|
||||
"input.budgetCents",
|
||||
"input.winProbability",
|
||||
"budget.allocatedCents",
|
||||
]));
|
||||
expect(result.links.length).toBeGreaterThan(0);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user