mirror of
https://github.com/aljazceru/ditto.git
synced 2026-01-13 02:24:20 +01:00
test: getZapSplits function return empty object
This commit is contained in:
@@ -34,3 +34,27 @@ Deno.test('Get zap splits in DittoZapSplits format', async () => {
|
||||
|
||||
assertEquals(await getZapSplits(store, 'garbage'), undefined);
|
||||
});
|
||||
|
||||
Deno.test('Zap split is empty', async () => {
|
||||
const { store } = await getTestDB();
|
||||
|
||||
const sk = generateSecretKey();
|
||||
const pubkey = getPublicKey(sk);
|
||||
|
||||
const event = genEvent({
|
||||
kind: 30078,
|
||||
tags: [
|
||||
['d', 'pub.ditto.zapSplits'],
|
||||
['p', 'baka'],
|
||||
],
|
||||
}, sk);
|
||||
await store.event(event);
|
||||
|
||||
const eventFromDb = await store.query([{ kinds: [30078], authors: [pubkey] }]);
|
||||
|
||||
assertEquals(eventFromDb.length, 1);
|
||||
|
||||
const zapSplits = await getZapSplits(store, pubkey);
|
||||
|
||||
assertEquals(zapSplits, {});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user