From 4b98ab557ad782b554847194e53c25b5edab1917 Mon Sep 17 00:00:00 2001 From: HDegroote <75906619+HDegroote@users.noreply.github.com> Date: Wed, 15 Jan 2025 09:23:39 +0100 Subject: [PATCH] Fix incorrect assertion --- test/atomic.js | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/test/atomic.js b/test/atomic.js index bb5b0ad..9852c06 100644 --- a/test/atomic.js +++ b/test/atomic.js @@ -33,12 +33,15 @@ test('write to original core while there is an atomized one', async (t) => { const atomCore = core.atomize(atom) await writeBlocks(core, 1, { start: 2 }) + const expected = [...initBlocks, b4a.from('block2'), null] - { - const expected = [...initBlocks, b4a.from('block2'), null] - t.alike(await readBlocks(core, 4), expected, 'added to original core') - t.alike(await readBlocks(atomCore, 4), expected, 'added to atomized core') - } + t.alike(await readBlocks(core, 4), expected, 'added to original core') + t.alike(await readBlocks(atomCore, 4), expected, 'added to atomized core') + + await atom.flush() + + t.alike(await readBlocks(core, 4), expected, 'flushed core') + t.alike(await readBlocks(atomCore, 4), expected, 'flushed atom core') }) test('first writes to a core are from an atom', async (t) => { @@ -52,8 +55,10 @@ test('first writes to a core are from an atom', async (t) => { const expected = [b4a.from('block0'), null] t.alike(await readBlocks(atomCore, 2), expected, 'added to atom core') t.alike(await readBlocks(core, 2), [null, null], 'not yet added to original') + await atom.flush() - t.alike(await readBlocks(atomCore, 2), expected, 'added to original after flush') + + t.alike(await readBlocks(core, 2), expected, 'added to original after flush') }) test('atomized flow with write/delete operations on a single core', async (t) => {