Custom add and create flow polish
This commit is contained in:
@@ -188,6 +188,43 @@ describe("buildPublishPayload — methodSelections", () => {
|
||||
expect(ms?.communication?.[0]?.label).toBe("Custom Comm");
|
||||
});
|
||||
|
||||
it("embeds wizard field blocks in published Communication sections for custom UUID ids", () => {
|
||||
const customId = "00000000-0000-4000-8000-000000000099";
|
||||
const r = buildPublishPayload({
|
||||
title: "T",
|
||||
selectedCommunicationMethodIds: [customId],
|
||||
sections: [
|
||||
{
|
||||
categoryName: "Communication",
|
||||
entries: [{ title: "Template row", body: "placeholder" }],
|
||||
},
|
||||
],
|
||||
customMethodCardMetaById: {
|
||||
[customId]: { label: "Wizard title", supportText: "" },
|
||||
},
|
||||
customMethodCardFieldBlocksById: {
|
||||
[customId]: [
|
||||
{
|
||||
kind: "text",
|
||||
id: "b1",
|
||||
blockTitle: "Field A",
|
||||
placeholderText: "User-authored body",
|
||||
},
|
||||
],
|
||||
},
|
||||
});
|
||||
expect(r.ok).toBe(true);
|
||||
if (!r.ok) return;
|
||||
const secs = r.document.sections as Array<{
|
||||
categoryName: string;
|
||||
entries: Array<{ blocks?: Array<{ label: string; body: string }> }>;
|
||||
}>;
|
||||
const comm = secs.find((s) => s.categoryName === "Communication");
|
||||
expect(comm?.entries[0]?.blocks).toEqual([
|
||||
{ label: "Field A", body: "User-authored body" },
|
||||
]);
|
||||
});
|
||||
|
||||
it("emits preset-only sections when a method is selected without an override", () => {
|
||||
const r = buildPublishPayload({
|
||||
title: "T",
|
||||
|
||||
Reference in New Issue
Block a user