summaryrefslogtreecommitdiffhomepage
path: root/src/features/chat/store.test.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/features/chat/store.test.ts')
-rw-r--r--src/features/chat/store.test.ts8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/features/chat/store.test.ts b/src/features/chat/store.test.ts
index 2d75139..c1d62a6 100644
--- a/src/features/chat/store.test.ts
+++ b/src/features/chat/store.test.ts
@@ -1057,8 +1057,9 @@ describe("createChatStore", () => {
}
expect(store.chunks).toHaveLength(15);
- // Reader returns to the bottom — but provisional chunks are never unloaded,
- // so the deferred trim still can't shrink an all-provisional transcript.
+ // Reader returns to the bottom — the deferred trim now catches up.
+ // With no committed chunks, it drops the oldest provisional chunks
+ // (the in-flight turn) to stay within the limit.
atBottom = true;
store.handleDelta(
deltaEvent({
@@ -1071,7 +1072,8 @@ describe("createChatStore", () => {
stepId: "t1#15" as StepId,
}),
);
- expect(store.chunks).toHaveLength(16);
+ // 16 provisional, limit 10, quarter 3 → drop 6 oldest → 10 remain.
+ expect(store.chunks).toHaveLength(10);
store.dispose();
});