From 9dd5f92ce84cb3ff73abaca3b65c6127adfa9433 Mon Sep 17 00:00:00 2001 From: Andre Staltz Date: Fri, 28 Apr 2023 11:27:00 +0300 Subject: [PATCH] test initializeFeed idempotency --- test/initializeFeed.test.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test/initializeFeed.test.js b/test/initializeFeed.test.js index 36b508d..bf3c959 100644 --- a/test/initializeFeed.test.js +++ b/test/initializeFeed.test.js @@ -29,5 +29,12 @@ test('initializeFeed()', async (t) => { t.ok(peer.db.getFeedRoot(keys.id, 'profile'), 'has profile feed') + const rootHash2 = await p(peer.db.initializeFeed)({ type: 'profile' }) + t.pass('initialized feed is idempotent') + + t.equals(rootHash2, FeedV1.getMsgHash(rootMsg), 'root hash is consistent') + + t.ok(peer.db.getFeedRoot(keys.id, 'profile'), 'still has profile feed') + await p(peer.close)(true) })