test(daemon): align the entries relay assertion with workspace.query{kind:entries}

This commit is contained in:
yuez committed 2026-10-21 14:43:46 +08:00
1 parent 854d6d2997
commit 31f36302bd
1 file changed
+5 -3
+5 -3
View File
@@ -179,7 +179,7 @@ describe("HTTP API", () => {
if (call.method === "workspace.query" && call.params?.kind === "sessions") { if (call.method === "workspace.query" && call.params?.kind === "sessions") {
return { seq: 1, disposition: "started", sessions: [{ sessionId: "s1" }] } as never; return { seq: 1, disposition: "started", sessions: [{ sessionId: "s1" }] } as never;
} }
if (call.method === "session.entries") { if (call.method === "workspace.query" && call.params?.kind === "entries") {
return { seq: 1, disposition: "started", entries: [{ id: "e1" }] } as never; return { seq: 1, disposition: "started", entries: [{ id: "e1" }] } as never;
} }
return { seq: 1, disposition: "started" }; return { seq: 1, disposition: "started" };
@@ -192,8 +192,10 @@ describe("HTTP API", () => {
const entries = await fetch(`${h.url}/api/v1/sessions/s1/entries?before=e9&limit=25`, authed()); const entries = await fetch(`${h.url}/api/v1/sessions/s1/entries?before=e9&limit=25`, authed());
expect(entries.status).toBe(200); expect(entries.status).toBe(200);
const entryCall = conn.commands.find((call) => call.method === "session.entries"); const entryCall = conn.commands.find(
expect(entryCall?.params).toEqual({ before: "e9", limit: 25 }); (call) => call.method === "workspace.query" && call.params?.kind === "entries",
);
expect(entryCall?.params).toEqual({ before: "e9", limit: 25, kind: "entries" });
expect((await entries.json()) as { entries: unknown[] }).toHaveProperty("entries"); expect((await entries.json()) as { entries: unknown[] }).toHaveProperty("entries");
const attention = await fetch(`${h.url}/api/v1/attention?workspaceId=ws-1`, authed()); const attention = await fetch(`${h.url}/api/v1/attention?workspaceId=ws-1`, authed());