mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-13 23:11:40 +00:00
test(ui/mcp): drop unnecessary as any casts from BYOK mock return values
The four `mockResolvedValue(... as any)` casts added for the BYOK tests pushed the project-wide @typescript-eslint/no-explicit-any budget from 2040 to 2044, failing the lint-budget gate. createMCPServer/updateMCPServer have no explicit return type (apiClient.post resolves to any), so the mock accepts these objects without a cast; removing the casts keeps the tests green and brings the budget back to 2040.
This commit is contained in:
parent
5a7f9157fb
commit
093f4faf15
2 changed files with 4 additions and 4 deletions
|
|
@ -854,7 +854,7 @@ describe("CreateMCPServer BYOK toggle", () => {
|
|||
});
|
||||
await waitFor(() => expect(screen.queryByText("Authentication Value")).not.toBeInTheDocument());
|
||||
|
||||
vi.mocked(networking.createMCPServer).mockResolvedValue({ server_id: "byok-1" } as any);
|
||||
vi.mocked(networking.createMCPServer).mockResolvedValue({ server_id: "byok-1" });
|
||||
|
||||
await act(async () => {
|
||||
fireEvent.click(screen.getByRole("button", { name: "Add MCP Server" }));
|
||||
|
|
@ -885,7 +885,7 @@ describe("CreateMCPServer BYOK toggle", () => {
|
|||
await selectAntOption("Authentication", "None");
|
||||
await waitFor(() => expect(screen.queryByText(BYOK_LABEL)).not.toBeInTheDocument());
|
||||
|
||||
vi.mocked(networking.createMCPServer).mockResolvedValue({ server_id: "switched-1" } as any);
|
||||
vi.mocked(networking.createMCPServer).mockResolvedValue({ server_id: "switched-1" });
|
||||
|
||||
await act(async () => {
|
||||
fireEvent.click(screen.getByRole("button", { name: "Add MCP Server" }));
|
||||
|
|
|
|||
|
|
@ -995,7 +995,7 @@ describe("MCPServerEdit (BYOK)", () => {
|
|||
});
|
||||
|
||||
it("persists is_byok=true when saving an existing BYOK server", async () => {
|
||||
vi.mocked(networking.updateMCPServer).mockResolvedValue(byokServer as any);
|
||||
vi.mocked(networking.updateMCPServer).mockResolvedValue(byokServer);
|
||||
|
||||
render(
|
||||
<MCPServerEdit
|
||||
|
|
@ -1015,7 +1015,7 @@ describe("MCPServerEdit (BYOK)", () => {
|
|||
});
|
||||
|
||||
it("persists is_byok=false and restores the shared auth value field when BYOK is toggled off", async () => {
|
||||
vi.mocked(networking.updateMCPServer).mockResolvedValue({ ...byokServer, is_byok: false } as any);
|
||||
vi.mocked(networking.updateMCPServer).mockResolvedValue({ ...byokServer, is_byok: false });
|
||||
|
||||
render(
|
||||
<MCPServerEdit
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue