fix: normalise compatible live reconstruction responses
This commit is contained in:
@@ -46,6 +46,9 @@ function makeAnalysisResult(overrides = {}) {
|
||||
id: "q-1",
|
||||
question: "What denominator is being used for the complaint rate?",
|
||||
},
|
||||
compatibilityApplied: false,
|
||||
compatibilityChanges: [],
|
||||
compatibilityWarnings: [],
|
||||
...overrides,
|
||||
};
|
||||
}
|
||||
@@ -171,6 +174,29 @@ describe("lib/graph/orchestrator startCase", () => {
|
||||
expect(result.selectedQuestion).toBeNull();
|
||||
});
|
||||
|
||||
it("includes compatibility diagnostics when provided by analysis", async () => {
|
||||
mockAnalyseScenario.mockResolvedValue(
|
||||
makeAnalysisResult({
|
||||
compatibilityApplied: true,
|
||||
compatibilityChanges: [
|
||||
{
|
||||
path: ["evidence", 0, "source"],
|
||||
change: "Converted null source to undefined",
|
||||
},
|
||||
],
|
||||
compatibilityWarnings: [
|
||||
"Applied deterministic reconstruction compatibility normalisation",
|
||||
],
|
||||
}),
|
||||
);
|
||||
const { startCase } = await import("@/lib/graph/orchestrator.js");
|
||||
|
||||
const result = await startCase({ scenario: "Scenario text" });
|
||||
|
||||
expect(result.diagnostics.compatibilityApplied).toBe(true);
|
||||
expect(result.diagnostics.compatibilityChanges).toHaveLength(1);
|
||||
});
|
||||
|
||||
it("exports placeholder updateCase", async () => {
|
||||
const { updateCase } = await import("@/lib/graph/orchestrator.js");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user