mirror of
https://github.com/CopilotKit/CopilotKit.git
synced 2026-09-14 16:26:20 +08:00
534cd1efa7
Per-framework fixes to pass D5 e2e-deep probes: - agno: deduplicate agent_server routes - claude-sdk-python: handle ParsedContentBlockStopEvent (SDK v0.97+) - claude-sdk-typescript: remove orphan tool-rendering page - crewai-crews: add backend tool_rendering agent + shared_state fix - google-adk: add AGUIToolset to all ADK agents for frontend tools - langgraph-typescript: remove stale import - langroid: emit ToolCallResultEvent for backend tools + fix adapter - llamaindex: v2 provider import, book_call stub, PYTHONPATH fix - ms-agent-python: disable Responses API store for aimock compat - pydantic-ai: simplify gen-ui page component - spring-ai: raise tool iteration cap (1→5) + fix connection pooling - strands: shared tools symlink + requirements update
53 lines
1.5 KiB
TypeScript
53 lines
1.5 KiB
TypeScript
import { describe, it, expect } from "vitest";
|
|
import { searchFlightsImpl } from "../search-flights";
|
|
import type { Flight } from "../types";
|
|
|
|
describe("searchFlightsImpl", () => {
|
|
const mockFlight: Flight = {
|
|
airline: "Test Air",
|
|
airlineLogo: "https://example.com/logo.png",
|
|
flightNumber: "TA100",
|
|
origin: "SFO",
|
|
destination: "JFK",
|
|
date: "Tue, Apr 15",
|
|
departureTime: "08:00",
|
|
arrivalTime: "16:00",
|
|
duration: "5h",
|
|
status: "On Time",
|
|
statusColor: "#22c55e",
|
|
price: "$299",
|
|
currency: "USD",
|
|
};
|
|
|
|
it("returns flights and schema", () => {
|
|
const result = searchFlightsImpl([mockFlight]);
|
|
expect(result).toHaveProperty("flights");
|
|
expect(result).toHaveProperty("schema");
|
|
});
|
|
|
|
it("passes flights through unchanged", () => {
|
|
const result = searchFlightsImpl([mockFlight]);
|
|
expect(result.flights).toHaveLength(1);
|
|
expect(result.flights[0]).toEqual(mockFlight);
|
|
});
|
|
|
|
it("returns empty schema object", () => {
|
|
const result = searchFlightsImpl([mockFlight]);
|
|
expect(result.schema).toEqual({});
|
|
});
|
|
|
|
it("handles empty flights array", () => {
|
|
const result = searchFlightsImpl([]);
|
|
expect(result.flights).toHaveLength(0);
|
|
});
|
|
|
|
it("handles multiple flights", () => {
|
|
const result = searchFlightsImpl([
|
|
mockFlight,
|
|
{ ...mockFlight, flightNumber: "TA200" },
|
|
]);
|
|
expect(result.flights).toHaveLength(2);
|
|
expect(result.flights[1].flightNumber).toBe("TA200");
|
|
});
|
|
});
|