feat(gate): buildSchemaLinkingRequest descriptor builder

This commit is contained in:
2026-07-06 23:25:00 +02:00
committed by Marco Pancotti
parent 00365cc6e6
commit 559f52e26e
2 changed files with 31 additions and 0 deletions
@@ -15,6 +15,7 @@ const {
buildArtifactGate,
buildInfoRequest,
buildFreetextRequest,
buildSchemaLinkingRequest,
withChildLinkage,
} = require("../builders.js");
@@ -118,6 +119,17 @@ test("freetext request carries a title and no options", () => {
assert.deepEqual(result.reserved, ["back", "exit", "other"]);
});
test("buildSchemaLinkingRequest carries tables + reserved", () => {
const out = buildSchemaLinkingRequest({
id: "u7", phase: "F4", title: "F4 — Schema linking",
tables: [{ id: "t1", name: "dim_patient", kind: "promote", columns: [] }],
});
assert.equal(out.widget, "schema-linking");
assert.equal(out.id, "u7");
assert.equal(out.tables.length, 1);
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);