mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-02-04 09:13:08 +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(
|
vi.mocked(sdk.query).mockReturnValue(
|
||||||
(async function* () {
|
(async function* () {
|
||||||
yield { type: "text", text: "test" };
|
yield { type: "text", text: "test" };
|
||||||
@@ -176,13 +176,18 @@ describe("claude-provider.ts", () => {
|
|||||||
prompt: "Current message",
|
prompt: "Current message",
|
||||||
cwd: "/test",
|
cwd: "/test",
|
||||||
conversationHistory,
|
conversationHistory,
|
||||||
|
sdkSessionId: "test-session-id",
|
||||||
});
|
});
|
||||||
|
|
||||||
await collectAsyncGenerator(generator);
|
await collectAsyncGenerator(generator);
|
||||||
|
|
||||||
// Should pass an async generator as prompt
|
// Should use resume option when sdkSessionId is provided with history
|
||||||
const callArgs = vi.mocked(sdk.query).mock.calls[0][0];
|
expect(sdk.query).toHaveBeenCalledWith({
|
||||||
expect(typeof callArgs.prompt).not.toBe("string");
|
prompt: "Current message",
|
||||||
|
options: expect.objectContaining({
|
||||||
|
resume: "test-session-id",
|
||||||
|
}),
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should handle array prompt (with images)", async () => {
|
it("should handle array prompt (with images)", async () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user