diff --git a/client/src/lib/hooks/__tests__/useConnection.test.tsx b/client/src/lib/hooks/__tests__/useConnection.test.tsx index 21563689..ccd92965 100644 --- a/client/src/lib/hooks/__tests__/useConnection.test.tsx +++ b/client/src/lib/hooks/__tests__/useConnection.test.tsx @@ -608,105 +608,6 @@ describe("useConnection", () => { required: ["name"], }); }); - test("resolves nested $ref references within $defs definitions", async () => { - const mockProtocolOnMessage = jest.fn(); - - mockSSETransport.onmessage = mockProtocolOnMessage; - - const { result } = renderHook(() => useConnection(defaultProps)); - - await act(async () => { - await result.current.connect(); - }); - - // This mirrors the pattern from FastMCP where a definition references another definition - const mockRequestWithNestedDefs: JSONRPCMessage = { - jsonrpc: "2.0", - id: 1, - method: "elicitation/create", - params: { - message: "Please provide your information", - requestedSchema: { - type: "object", - properties: { - person: { - $ref: "#/$defs/PersonWithAddress", - }, - }, - $defs: { - PersonWithAddress: { - type: "object", - properties: { - name: { - type: "string", - title: "Name", - }, - address: { - $ref: "#/$defs/Address", // ← Nested ref: definition references another definition - }, - }, - required: ["name", "address"], - }, - Address: { - type: "object", - properties: { - street: { - type: "string", - title: "Street", - }, - city: { - type: "string", - title: "City", - }, - zipcode: { - type: "string", - title: "Zipcode", - }, - }, - required: ["street", "city", "zipcode"], - }, - }, - }, - }, - }; - - await act(async () => { - mockSSETransport.onmessage!(mockRequestWithNestedDefs); - }); - - expect(mockProtocolOnMessage).toHaveBeenCalledTimes(1); - - const message = mockProtocolOnMessage.mock.calls[0][0]; - // The $ref should be resolved, and nested refs within $defs should also be resolved - expect(message.params.requestedSchema.properties.person).toEqual({ - type: "object", - properties: { - name: { - type: "string", - title: "Name", - }, - address: { - type: "object", - properties: { - street: { - type: "string", - title: "Street", - }, - city: { - type: "string", - title: "City", - }, - zipcode: { - type: "string", - title: "Zipcode", - }, - }, - required: ["street", "city", "zipcode"], - }, - }, - required: ["name", "address"], - }); - }); }); describe("URL Port Handling", () => {