fix: make join review read only

This commit is contained in:
User
2026-07-14 15:06:16 +02:00
parent c7474f3852
commit 27af6733c8
11 changed files with 378 additions and 22 deletions
@@ -16,6 +16,7 @@ const {
buildInfoRequest,
buildFreetextRequest,
buildSchemaLinkingRequest,
buildJoinReviewRequest,
withChildLinkage,
} = require("../builders.js");
@@ -130,6 +131,34 @@ test("buildSchemaLinkingRequest carries tables + reserved", () => {
assert.deepEqual(out.reserved, ["back", "exit", "other"]);
});
test("buildJoinReviewRequest exposes joins as read-only review items", () => {
const out = buildJoinReviewRequest({
id: "u8",
phase: "F4",
title: "F4 — Proposed joins",
options: [
{
id: "patient-events",
label: "Patient to events",
detail: "JOIN dim_patient p ON p.cod_paz = e.cod_paz",
rationale: "Standard patient key",
},
],
});
assert.equal(out.widget, "join-review");
assert.equal(out.confirm_label, "Continue");
assert.deepEqual(out.options, [
{
id: "patient-events",
label: "Patient to events",
detail: "JOIN dim_patient p ON p.cod_paz = e.cod_paz",
rationale: "Standard patient key",
},
]);
assert.deepEqual(out.reserved, ["back", "exit", "other"]);
});
test("withChildLinkage sets option.opens and returns the option", () => {
const child = { widget: "freetext", title: "Motivazione del rifiuto" };
const option = withChildLinkage({ id: "reject", label: "Rifiuta" }, child);