This commit is contained in:
Ben Irvin 2023-09-28 10:31:17 +02:00
parent 26753c2c6f
commit e5eb30b2a3

View File

@ -154,6 +154,17 @@ describe('Core API - Validate', () => {
expect(res.status).toEqual(400);
});
it.each([
['at root', { id: {} }],
['nested known keys', { id: { $and: { $eq: {}, $contains: {} } } }],
['nested unknown keys', { id: { foo: { foo: {} } } }],
])('Empty objects are accepted but sanitized out: %s : %s', async (label, filters) => {
const res = await rq.get('/api/documents', { qs: { filters } });
expect(res.status).toEqual(200);
checkAPIResultLength(res, documentsLength());
});
});
describe('Scalar', () => {