From 386163b77fe39378df2ace27d61b97168f161d15 Mon Sep 17 00:00:00 2001 From: Evan Hahn Date: Mon, 18 Nov 2024 16:38:30 +0000 Subject: [PATCH] test: assert correct number of connected devices In [#872], we observed a bug where we seemingly had the wrong number of remote sync states. This adds a test assertion that we have the right number. [#872]: https://github.com/digidem/comapeo-core/issues/872 --- test-e2e/sync.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test-e2e/sync.js b/test-e2e/sync.js index 95fb1a43..72a0bf25 100644 --- a/test-e2e/sync.js +++ b/test-e2e/sync.js @@ -855,6 +855,12 @@ test('Correct sync state prior to data sync', async function (t) { managers.map((m) => m.getProject(projectId)) ) + for (const project of projects) { + const { remoteDeviceSyncState } = project.$sync.getState() + const otherDeviceCount = Object.keys(remoteDeviceSyncState).length + assert.equal(otherDeviceCount, COUNT - 1) + } + const generated = await seedDatabases(projects, { schemas: ['observation'] }) await waitForSync(projects, 'initial')