fix: make join review read only
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user