mirror of
https://gitlab.com/soapbox-pub/ditto.git
synced 2025-12-06 03:19:46 +00:00
test(EventsDB): throw error for large since, until and kinds filter
This commit is contained in:
parent
cac5c9c1e0
commit
360efe089d
1 changed files with 30 additions and 0 deletions
|
|
@ -191,3 +191,33 @@ Deno.test('inserting replaceable events', async () => {
|
|||
await eventsDB.event(newerEvent);
|
||||
assertEquals(await eventsDB.query([{ kinds: [0] }]), [newerEvent]);
|
||||
});
|
||||
|
||||
Deno.test("throws a Error when querying an event with a large 'since'", async () => {
|
||||
const { eventsDB } = await createDB();
|
||||
|
||||
await assertRejects(
|
||||
() => eventsDB.query([{ since: 33333333333333 }]),
|
||||
Error,
|
||||
'since filter too far into the future',
|
||||
);
|
||||
});
|
||||
|
||||
Deno.test("throws a Error when querying an event with a large 'until'", async () => {
|
||||
const { eventsDB } = await createDB();
|
||||
|
||||
await assertRejects(
|
||||
() => eventsDB.query([{ until: 66666666666666 }]),
|
||||
Error,
|
||||
'until filter too far into the future',
|
||||
);
|
||||
});
|
||||
|
||||
Deno.test("throws a Error when querying an event with a large 'kind'", async () => {
|
||||
const { eventsDB } = await createDB();
|
||||
|
||||
await assertRejects(
|
||||
() => eventsDB.query([{ kinds: [99999999999999] }]),
|
||||
Error,
|
||||
'kind filter too far into the future',
|
||||
);
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue