test(api): cover assistant holiday calendar reads
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
import { beforeEach, describe, expect, it, vi } from "vitest";
|
||||
|
||||
import {
|
||||
createToolContext,
|
||||
executeTool,
|
||||
} from "./assistant-tools-holiday-read-test-helpers.js";
|
||||
|
||||
describe("assistant holiday calendar get tools", () => {
|
||||
beforeEach(() => {
|
||||
vi.clearAllMocks();
|
||||
});
|
||||
|
||||
it("returns a stable error when a holiday calendar cannot be found by identifier", async () => {
|
||||
const ctx = createToolContext({
|
||||
holidayCalendar: {
|
||||
findUnique: vi.fn().mockResolvedValue(null),
|
||||
findFirst: vi.fn().mockResolvedValue(null),
|
||||
},
|
||||
});
|
||||
|
||||
const result = await executeTool(
|
||||
"get_holiday_calendar",
|
||||
JSON.stringify({ identifier: "Missing Calendar" }),
|
||||
ctx,
|
||||
);
|
||||
|
||||
expect(JSON.parse(result.content)).toEqual({
|
||||
error: "Holiday calendar not found: Missing Calendar",
|
||||
});
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user