From 198ea7e85f25e864bbd9df87d60f0d5462de2755 Mon Sep 17 00:00:00 2001 From: Yuneng Jiang Date: Tue, 18 Aug 2026 21:53:57 -0700 Subject: [PATCH] test(ui): cover object-shaped MCP access groups in the save payload net The net had no case where `mcp_access_groups` arrives as objects rather than strings, which left the normalising `.map()` in the payload builder untested. Adding the case shows the normalisation is currently a no-op: the payload carries the group names either way, because the antd Select hands `validateFields()` plain strings before the mapping ever runs. The line is dead today for that reason, not because the spread above it duplicates the value Worth pinning rather than deleting. The form migration replaces that Select, and a replacement control that yields objects would make the mapping load-bearing again. This case is what would catch it --- .../_components/mcp_server_edit.integration.test.tsx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ui/litellm-dashboard/src/app/(dashboard)/mcp-servers/_components/mcp_server_edit.integration.test.tsx b/ui/litellm-dashboard/src/app/(dashboard)/mcp-servers/_components/mcp_server_edit.integration.test.tsx index a9664191f3f..91b52065e72 100644 --- a/ui/litellm-dashboard/src/app/(dashboard)/mcp-servers/_components/mcp_server_edit.integration.test.tsx +++ b/ui/litellm-dashboard/src/app/(dashboard)/mcp-servers/_components/mcp_server_edit.integration.test.tsx @@ -299,6 +299,11 @@ const CASES: readonly Case[] = [ server: { ...BASE, allowed_tools: [] }, expected: { ...EXPECTED_BASE }, }, + { + label: "object-shaped access groups are normalised to their names", + server: { ...BASE, mcp_access_groups: [{ name: "eng" }, "ops"] as never }, + expected: { ...EXPECTED_BASE, mcp_access_groups: ["eng", "ops"] }, + }, ]; const saveAndCapture = async (server: MCPServer): Promise> => {