test initializeFeed idempotency

This commit is contained in:
Andre Staltz 2023-04-28 11:27:00 +03:00
parent 6ab3182613
commit 9dd5f92ce8
No known key found for this signature in database
GPG Key ID: 9EDE23EA7E8A4890
1 changed files with 7 additions and 0 deletions

View File

@ -29,5 +29,12 @@ test('initializeFeed()', async (t) => {
t.ok(peer.db.getFeedRoot(keys.id, 'profile'), 'has profile feed') 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) await p(peer.close)(true)
}) })