diff --git a/web/src/lib/taskQueries.test.ts b/web/src/lib/taskQueries.test.ts index 342091e..16bfa8f 100644 --- a/web/src/lib/taskQueries.test.ts +++ b/web/src/lib/taskQueries.test.ts @@ -181,6 +181,22 @@ describe('GET /api/lists/[id]/tasks?tags=', () => { expect((await res.json() as { id: string }[]).map((t) => t.id)).toEqual([a.t2]); }); + it('applies dueDate with a tag filter', async () => { + const a = await seedAccount(); + await exec('UPDATE sl_tasks SET due_date = $1 WHERE id = $2', ['2026-01-10T00:00:00Z', a.t1]); + // t2 (blue too) has no due date: excluded by the dueDate filter + const res = await getTasks(a.userId, a.list, `?tags=${a.blue}&dueDate=2026-02-01T00:00:00Z`); + expect(res.status).toBe(200); + expect((await res.json() as { id: string }[]).map((t) => t.id)).toEqual([a.t1]); + }); + + it('ignores a non-integer priority instead of failing', async () => { + const a = await seedAccount(); + const res = await getTasks(a.userId, a.list, '?priority=abc'); + expect(res.status).toBe(200); + expect((await res.json() as { id: string }[]).map((t) => t.id)).toEqual([a.t1, a.t2, a.t3]); + }); + it('still answers 404 for a list of another account', async () => { const a = await seedAccount(); const res = await getTasks(`user-${u()}`, a.list, '');