x
This commit is contained in:
1 parent
167d07f0c2
commit
9a915ee395
6 files changed
+264
-40
No files matched your search
@@ -129,6 +129,30 @@ describe("Footer MCP proxy handlers", () => {
|
||||
});
|
||||
});
|
||||
|
||||
test("preserves the compact contract for an allowed menu that does not exist", async () => {
|
||||
const { api } = createApi({
|
||||
success: true,
|
||||
menuName: "footer-support",
|
||||
exists: false,
|
||||
version: null,
|
||||
lang: "th",
|
||||
items: [],
|
||||
});
|
||||
const result = await handleMenuTool(api, "get_footer_menu", {
|
||||
menuName: "footer-support",
|
||||
});
|
||||
|
||||
expect(output(result)).toEqual({
|
||||
success: true,
|
||||
operation: "get_footer_menu",
|
||||
menuName: "footer-support",
|
||||
exists: false,
|
||||
version: null,
|
||||
lang: "th",
|
||||
items: [],
|
||||
});
|
||||
});
|
||||
|
||||
test("adds an item with write controls", async () => {
|
||||
const { api, calls } = createApi();
|
||||
await handleMenuTool(api, "add_footer_menu_item", {
|
||||
@@ -155,6 +179,45 @@ describe("Footer MCP proxy handlers", () => {
|
||||
});
|
||||
});
|
||||
|
||||
test("preserves a dry-run bootstrap preview for an absent allowed menu", async () => {
|
||||
const { api } = createApi({
|
||||
success: true,
|
||||
operation: "add_footer_menu_item",
|
||||
menuName: "footer-explore",
|
||||
dryRun: true,
|
||||
exists: false,
|
||||
willCreateMenu: true,
|
||||
version: null,
|
||||
item: {
|
||||
label: "Shop",
|
||||
url: "/shop",
|
||||
order: 1,
|
||||
},
|
||||
});
|
||||
const result = await handleMenuTool(api, "add_footer_menu_item", {
|
||||
menuName: "footer-explore",
|
||||
label: "Shop",
|
||||
url: "/shop",
|
||||
order: 1,
|
||||
dryRun: true,
|
||||
});
|
||||
|
||||
expect(output(result)).toEqual({
|
||||
success: true,
|
||||
operation: "add_footer_menu_item",
|
||||
menuName: "footer-explore",
|
||||
dryRun: true,
|
||||
exists: false,
|
||||
willCreateMenu: true,
|
||||
version: null,
|
||||
item: {
|
||||
label: "Shop",
|
||||
url: "/shop",
|
||||
order: 1,
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
test("partially updates an item without forwarding unrelated fields", async () => {
|
||||
const { api, calls } = createApi();
|
||||
await handleMenuTool(api, "update_footer_menu_item", {
|
||||
|
||||
Reference in new issue
Block a user