mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-11 22:51:28 +00:00
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:
parent
f20443b5e0
commit
198ea7e85f
1 changed files with 5 additions and 0 deletions
|
|
@ -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>> => {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue