feat: add one-turn situation graph update UI
This commit is contained in:
@@ -280,6 +280,60 @@ describe("applyValidatedProposal", () => {
|
||||
expect(result.updatedSituationGraph.resolvedNodeIds).toContain(
|
||||
ids.complaintRateUnknown,
|
||||
);
|
||||
expect(
|
||||
result.updatedSituationGraph.nodes.find(
|
||||
(node) => node.id === ids.complaintRateUnknown,
|
||||
)?.status,
|
||||
).toBe("resolved");
|
||||
});
|
||||
|
||||
it("rejects resolvedUnknownNodeIds that do not reference actual unknown nodes", () => {
|
||||
const { graph, proposal, ids } = makeApplicationFixture();
|
||||
|
||||
const result = applyValidatedProposal({
|
||||
situationGraph: graph,
|
||||
proposal: {
|
||||
...proposal,
|
||||
resolvedUnknownNodeIds: [ids.qualityDeterioration],
|
||||
},
|
||||
});
|
||||
|
||||
expect(result.success).toBe(false);
|
||||
expect(result.stage).toBe("proposal_compatibility");
|
||||
expect(result.errors.join(" ")).toContain(
|
||||
"Resolved unknown must reference an existing unknown node",
|
||||
);
|
||||
});
|
||||
|
||||
it("rejects a duplicate semantic node without resolution", () => {
|
||||
const { graph, proposal } = makeApplicationFixture();
|
||||
|
||||
const result = applyValidatedProposal({
|
||||
situationGraph: graph,
|
||||
proposal: {
|
||||
...proposal,
|
||||
resolvedUnknownNodeIds: [],
|
||||
updatedNodes: proposal.updatedNodes.filter(
|
||||
(update) => update.nodeId !== "n-complaint-rate-unknown",
|
||||
),
|
||||
addedNodes: [
|
||||
makeNode({
|
||||
id: "n-parallel-rate",
|
||||
label: "Complaint rate",
|
||||
description: "Need the complaint rate per 100 units",
|
||||
kind: "observation",
|
||||
status: "supported",
|
||||
confidence: "medium",
|
||||
}),
|
||||
],
|
||||
},
|
||||
});
|
||||
|
||||
expect(result.success).toBe(false);
|
||||
expect(result.stage).toBe("proposal_compatibility");
|
||||
expect(result.errors.join(" ")).toContain(
|
||||
"duplicating unresolved unknown meaning",
|
||||
);
|
||||
});
|
||||
|
||||
it("keeps the active unknown when it remains unresolved", () => {
|
||||
|
||||
Reference in New Issue
Block a user