test(server): await provider child reads in the replay and pi child tests

These tests came in with the main merge. The child store reads are asynchronous now, so the tests compared a promise with the expected child.
This commit is contained in:
Mohamed Boudra
2026-11-11 04:00:11 +01:00
parent c4ce21a237
commit 183bc736ec
2 changed files with 5 additions and 3 deletions
@@ -88,7 +88,7 @@ describe("Claude workflow replay", () => {
await store.apply("parent", "claude", event);
}
expect(store.get("parent", TOOL_CALL_ID)).toMatchObject({
expect(await store.get("parent", TOOL_CALL_ID)).toMatchObject({
id: TOOL_CALL_ID,
title: "Workflow",
description: "Runs one deterministic child and returns its structured result",
@@ -113,7 +113,7 @@ describe("Claude workflow replay", () => {
await store.apply("parent", "claude", event);
}
expect(store.get("parent", TOOL_CALL_ID)).toMatchObject({
expect(await store.get("parent", TOOL_CALL_ID)).toMatchObject({
id: TOOL_CALL_ID,
title: "Workflow",
description: "Structured result workflow",
@@ -52,7 +52,9 @@ describe("@gotgenes/pi-subagents adapter", () => {
});
for (const event of events) await store.apply("parent", "pi", event.event);
expect(events.map(({ event }) => event.type)).toEqual(["upsert", "remove"]);
expect(store.list("parent")).toMatchObject([{ id: "previous-child", status: "completed" }]);
expect(await store.list("parent")).toMatchObject([
{ id: "previous-child", status: "completed" },
]);
},
);