mirror of
https://gitlab.com/soapbox-pub/ditto.git
synced 2025-12-06 11:29:46 +00:00
test: getZapSplits function return empty object
This commit is contained in:
parent
09eb444c9b
commit
1f9896bdbf
1 changed files with 24 additions and 0 deletions
|
|
@ -34,3 +34,27 @@ Deno.test('Get zap splits in DittoZapSplits format', async () => {
|
||||||
|
|
||||||
assertEquals(await getZapSplits(store, 'garbage'), undefined);
|
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, {});
|
||||||
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue