fix: link emergent unknowns to answer-derived graph nodes

This commit is contained in:
2026-08-02 12:17:49 +01:00
parent 392564ed61
commit 4affadab4b
4 changed files with 383 additions and 9 deletions
+44
View File
@@ -438,6 +438,26 @@ describe("graph-backed UI rendering", () => {
expect(html).toContain("Commercial value definition");
});
it("successful update renders prior and new state together", () => {
const html = renderToStaticMarkup(
<GraphUpdateView
updateResult={{
...makeUpdateSuccess(),
previousSituationGraph: makeGraphResult().situationGraph,
}}
/>,
);
expect(html).toContain("Previous active unknown");
expect(html).toContain("Resolved unknowns");
expect(html).toContain("Newly surfaced unknowns");
expect(html).toContain("New active unknown");
expect(html).toContain("Next question");
expect(html).toContain(
"How should commercial value be defined for this decision?",
);
});
it("situation graph marks newly surfaced and active unknowns", () => {
const html = renderToStaticMarkup(
<SituationGraphView
@@ -514,6 +534,30 @@ describe("graph-backed UI rendering", () => {
expect(html).toContain("bad proposal");
});
it("failed update does not fabricate history", () => {
const html = renderToStaticMarkup(
<>
<UpdateErrorPanel
updateError={{
error: "Update case failed",
errors: [
'New unknown must be explicitly related to an answer-derived node: "nu_commercial_val"',
],
}}
/>
<GraphUpdateView updateResult={null} />
</>,
);
expect(html).toContain("Update error: Update case failed");
expect(html).toContain("nu_commercial_val");
expect(html).not.toContain("Previous active unknown");
expect(html).not.toContain("Resolved unknowns");
expect(html).not.toContain("Newly surfaced unknowns");
expect(html).not.toContain("New active unknown");
expect(html).not.toContain("Proposal details");
});
it("proposal details remain collapsible", () => {
const html = renderToStaticMarkup(
<GraphUpdateView updateResult={makeUpdateSuccess()} />,