Skip to content

Commit 8eea69d

Browse files
committed
test(files): assert every peer edit lands (no false-green from a no-op peerInsertNear)
1 parent dec3c79 commit 8eea69d

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

apps/sim/app/workspace/[workspaceId]/files/components/file-viewer/rich-markdown-editor/collaboration/apply-streamed-markdown.concurrent.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ describe('two-writer: peer edits while the agent streams', () => {
168168

169169
applyAgentStreamFrame(A.editor, session, '# Title\n\noriginal body text extended')
170170
// Peer edits the SAME paragraph the agent is rewriting.
171-
peerInsertNear(B.editor, 'original', 'PEER ')
171+
expect(peerInsertNear(B.editor, 'original', 'PEER ')).toBe(true)
172172
applyAgentStreamFrame(A.editor, session, '# Title\n\nagent fully rewrote this paragraph')
173173
endAgentStream(session)
174174

apps/sim/app/workspace/[workspaceId]/files/components/file-viewer/rich-markdown-editor/collaboration/collab-streaming-integration.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,8 @@ describe('collab streaming integration — moving pieces', () => {
9090

9191
const session = beginAgentStream(A.editor)!
9292
applyAgentStreamFrame(A.editor, session, '# Title\n\nAlpha\n\nBeta\n\nGamma\n\nDelta')
93-
peerInsertNear(B.editor, 'Alpha', 'B_EDIT ') // peer B edits the top
94-
peerInsertNear(C.editor, 'Gamma', 'C_EDIT ') // peer C edits the bottom
93+
expect(peerInsertNear(B.editor, 'Alpha', 'B_EDIT ')).toBe(true) // peer B edits the top
94+
expect(peerInsertNear(C.editor, 'Gamma', 'C_EDIT ')).toBe(true) // peer C edits the bottom
9595
applyAgentStreamFrame(
9696
A.editor,
9797
session,
@@ -120,7 +120,7 @@ describe('collab streaming integration — moving pieces', () => {
120120
Y.applyUpdate(B.doc, Y.encodeStateAsUpdate(A.doc))
121121
wireMesh([A.doc, B.doc])
122122

123-
peerInsertNear(B.editor, 'base', 'PEER_UNDOABLE ') // peer's own edit (goes on peer's undo stack)
123+
expect(peerInsertNear(B.editor, 'base', 'PEER_UNDOABLE ')).toBe(true) // peer's own edit (undo stack)
124124
const session = beginAgentStream(A.editor)!
125125
applyAgentStreamFrame(
126126
A.editor,

0 commit comments

Comments
 (0)