From 1b6021561ad6abb10f2752121c92a1f4fcdce1a9 Mon Sep 17 00:00:00 2001 From: Peter van Hardenberg Date: Mon, 18 Dec 2023 09:32:34 -0800 Subject: [PATCH] fix test failure by testing what we claim to test --- packages/automerge-repo/test/remoteHeads.test.ts | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/packages/automerge-repo/test/remoteHeads.test.ts b/packages/automerge-repo/test/remoteHeads.test.ts index 3c20ea2dd..4a48af62d 100644 --- a/packages/automerge-repo/test/remoteHeads.test.ts +++ b/packages/automerge-repo/test/remoteHeads.test.ts @@ -165,11 +165,9 @@ describe("DocHandle.remoteHeads", () => { ).filter(({ type }) => type === "remote-heads-changed") // we should only be notified of the head changes of doc A - assert.strictEqual(remoteHeadsChangedMessages.length, 1) - assert.strictEqual( - remoteHeadsChangedMessages[0].documentId, - leftTabDocA.documentId - ) + const docIds = remoteHeadsChangedMessages.map(d => d.documentId) + const uniqueDocIds = [...new Set(docIds)] + assert.deepStrictEqual(uniqueDocIds, [leftTabDocA.documentId]) }) it("should report remote heads for doc on subscribe if peer already knows them", async () => {