feat: add option to change the default value of the Parse.Query.limit() constraint (#8152)
This commit is contained in:
@@ -462,6 +462,26 @@ describe('server', () => {
|
||||
.then(done);
|
||||
});
|
||||
|
||||
it('fails if default limit is negative', async () => {
|
||||
await expectAsync(reconfigureServer({ defaultLimit: -1 })).toBeRejectedWith(
|
||||
'Default limit must be a value greater than 0.'
|
||||
);
|
||||
});
|
||||
|
||||
it('fails if default limit is wrong type', async () => {
|
||||
for (const value of ["invalid", {}, [], true]) {
|
||||
await expectAsync(reconfigureServer({ defaultLimit: value})).toBeRejectedWith(
|
||||
'Default limit must be a number.'
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
it('fails if default limit is zero', async () => {
|
||||
await expectAsync(reconfigureServer({ defaultLimit: 0 })).toBeRejectedWith(
|
||||
'Default limit must be a value greater than 0.'
|
||||
);
|
||||
});
|
||||
|
||||
it('fails if maxLimit is negative', done => {
|
||||
reconfigureServer({ maxLimit: -100 }).catch(error => {
|
||||
expect(error).toEqual('Max limit must be a value greater than 0.');
|
||||
|
||||
Reference in New Issue
Block a user