Skip to content

Commit cd5018b

Browse files
committed
test: check export session arguments
1 parent 99bac07 commit cd5018b

1 file changed

Lines changed: 5 additions & 8 deletions

File tree

src/auto-reply/reply/commands-export-session.test.ts

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -204,13 +204,10 @@ describe("buildExportSessionReply", () => {
204204
});
205205

206206
expect(reply.text).toContain("✅ Session exported!");
207-
expect(hoisted.resolveCommandsSystemPromptBundleMock).toHaveBeenCalledWith(
208-
expect.objectContaining({
209-
sessionEntry: expect.objectContaining({
210-
sessionId: "session-from-store",
211-
}),
212-
}),
213-
);
207+
const systemPromptBundleParams =
208+
hoisted.resolveCommandsSystemPromptBundleMock.mock.calls[0]?.[0];
209+
expect(systemPromptBundleParams?.sessionEntry?.sessionId).toBe("session-from-store");
210+
expect(systemPromptBundleParams?.sessionEntry?.updatedAt).toBe(2);
214211
});
215212

216213
it("injects scripts and session data through the real export template", async () => {
@@ -255,7 +252,7 @@ describe("buildExportSessionReply", () => {
255252
"openclaw-session-session--2026-05-05T10-11-12-2.html",
256253
);
257254
expect(hoisted.writeFileMock.mock.calls[0]?.[0]).toBe(expectedBase);
258-
expect(hoisted.writeFileMock.mock.calls[0]?.[2]).toMatchObject({
255+
expect(hoisted.writeFileMock.mock.calls[0]?.[2]).toEqual({
259256
encoding: "utf-8",
260257
flag: "wx",
261258
});

0 commit comments

Comments
 (0)