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
This commit is contained in:
Yuneng Jiang 2026-08-18 21:53:57 -07:00
parent f20443b5e0
commit 198ea7e85f
No known key found for this signature in database

View file

@ -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<Record<string, unknown>> => {