Keep catalog method section editors after a Customize title override so Core Principle and related copy are not replaced by an empty custom-policy body.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
adilallo
2026-08-21 14:11:21 -06:00
co-authored by Cursor
parent 4006fe5c6c
commit 75ba0a214f
7 changed files with 152 additions and 7 deletions
+9
View File
@@ -4,6 +4,7 @@ import {
createFlowStepForCustomRuleFacetGroup,
CUSTOM_RULE_FACETS,
CUSTOM_RULE_FACET_BY_GROUP,
isCatalogMethodCardId,
METHOD_FACET_API_SECTION_IDS,
PUBLISHED_CUSTOM_RULE_SELECTION_KEYS,
readMethodPresetsForFacetGroup,
@@ -75,4 +76,12 @@ describe("customRuleFacets (CR-92)", () => {
expect(m.length).toBeGreaterThan(0);
expect(typeof m[0]!.id).toBe("string");
});
it("isCatalogMethodCardId is true for shipped slugs and false for UUIDs", () => {
expect(isCatalogMethodCardId("video-meetings")).toBe(true);
expect(isCatalogMethodCardId("signal")).toBe(true);
expect(
isCatalogMethodCardId("550e8400-e29b-41d4-a716-446655440000"),
).toBe(false);
});
});
@@ -125,4 +125,40 @@ describe("usesWizardFieldBlocksModalBody", () => {
}),
).toBe(true);
});
it("is false for catalog ids with a title-override meta row and no field blocks", () => {
expect(
usesWizardFieldBlocksModalBody({
methodId: "video-meetings",
meta: {
"video-meetings": {
label: "Video Meetings",
supportText: "Synchronous video calls.",
},
},
fieldBlocksById: { "video-meetings": [] },
modalEditUnlocked: false,
draftFieldBlocks: null,
customFacetDetailsMatchPreset: true,
}),
).toBe(false);
});
it("is true for catalog ids when persisted field blocks exist", () => {
expect(
usesWizardFieldBlocksModalBody({
methodId: "video-meetings",
meta: {
"video-meetings": {
label: "Video Meetings",
supportText: "Synchronous video calls.",
},
},
fieldBlocksById: { "video-meetings": blocks },
modalEditUnlocked: false,
draftFieldBlocks: null,
customFacetDetailsMatchPreset: true,
}),
).toBe(true);
});
});