mirror of https://codeberg.org/pzp/pzp-db.git
test initializeFeed idempotency
This commit is contained in:
parent
6ab3182613
commit
9dd5f92ce8
|
@ -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)
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue