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:
@@ -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);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user