mirror of
https://github.com/onyx-dot-app/onyx.git
synced 2026-10-22 11:22:49 -05:00
18 lines
576 B
TypeScript
18 lines
576 B
TypeScript
import type { Page } from "@playwright/test";
|
|
import { MCPTransportType, type MCPSetupProbeResult } from "@/lib/mcp/types";
|
|
|
|
export async function mockPublicMcpProbe(page: Page): Promise<void> {
|
|
const result: MCPSetupProbeResult = {
|
|
kind: "public",
|
|
transport: MCPTransportType.STREAMABLE_HTTP,
|
|
tool_count: 0,
|
|
server_name: "Test MCP server",
|
|
};
|
|
await page.route("**/api/admin/mcp/probe", async (route) => {
|
|
await route.fulfill({
|
|
contentType: "application/x-ndjson",
|
|
body: `${JSON.stringify({ type: "result", result })}\n`,
|
|
});
|
|
});
|
|
}
|