fix: Remove incorrect nested test
This commit is contained in:
parent
1598b28f3a
commit
6106b1b562
1 changed files with 0 additions and 99 deletions
|
|
@ -608,105 +608,6 @@ describe("useConnection", () => {
|
||||||
required: ["name"],
|
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", () => {
|
describe("URL Port Handling", () => {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue