mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-01-31 20:03:37 +00:00
test: update conversation history test to include sdkSessionId handling
- Renamed test case to clarify that it handles conversation history with sdkSessionId using the resume option. - Updated assertions to verify that the sdk.query method is called with the correct options when a session ID is provided.
This commit is contained in:
@@ -160,7 +160,7 @@ describe("claude-provider.ts", () => {
|
||||
});
|
||||
});
|
||||
|
||||
it("should handle conversation history", async () => {
|
||||
it("should handle conversation history with sdkSessionId using resume option", async () => {
|
||||
vi.mocked(sdk.query).mockReturnValue(
|
||||
(async function* () {
|
||||
yield { type: "text", text: "test" };
|
||||
@@ -176,13 +176,18 @@ describe("claude-provider.ts", () => {
|
||||
prompt: "Current message",
|
||||
cwd: "/test",
|
||||
conversationHistory,
|
||||
sdkSessionId: "test-session-id",
|
||||
});
|
||||
|
||||
await collectAsyncGenerator(generator);
|
||||
|
||||
// Should pass an async generator as prompt
|
||||
const callArgs = vi.mocked(sdk.query).mock.calls[0][0];
|
||||
expect(typeof callArgs.prompt).not.toBe("string");
|
||||
// Should use resume option when sdkSessionId is provided with history
|
||||
expect(sdk.query).toHaveBeenCalledWith({
|
||||
prompt: "Current message",
|
||||
options: expect.objectContaining({
|
||||
resume: "test-session-id",
|
||||
}),
|
||||
});
|
||||
});
|
||||
|
||||
it("should handle array prompt (with images)", async () => {
|
||||
|
||||
Reference in New Issue
Block a user