events.test: fix type error

This commit is contained in:
Alex Gleason 2023-12-29 13:53:09 -06:00
parent 56373c4ce3
commit 4ce51014de
No known key found for this signature in database
GPG Key ID: 7211D1F99744FBB7
1 changed files with 4 additions and 4 deletions

View File

@ -7,12 +7,12 @@ import { eventsDB as db } from './events.ts';
Deno.test('count filters', async () => {
assertEquals(await db.countEvents([{ kinds: [1] }]), 0);
await db.storeEvent(event1, { user: undefined });
await db.storeEvent(event1);
assertEquals(await db.countEvents([{ kinds: [1] }]), 1);
});
Deno.test('insert and filter events', async () => {
await db.storeEvent(event1, { user: undefined });
await db.storeEvent(event1);
assertEquals(await db.getEvents([{ kinds: [1] }]), [event1]);
assertEquals(await db.getEvents([{ kinds: [3] }]), []);
@ -25,14 +25,14 @@ Deno.test('insert and filter events', async () => {
});
Deno.test('delete events', async () => {
await db.storeEvent(event1, { user: undefined });
await db.storeEvent(event1);
assertEquals(await db.getEvents([{ kinds: [1] }]), [event1]);
await db.deleteEvents([{ kinds: [1] }]);
assertEquals(await db.getEvents([{ kinds: [1] }]), []);
});
Deno.test('query events with local filter', async () => {
await db.storeEvent(event1, { user: undefined });
await db.storeEvent(event1);
assertEquals(await db.getEvents([{}]), [event1]);
assertEquals(await db.getEvents([{ local: true }]), []);