Skip to content

Commit 731c005

Browse files
committed
Adds tests for limit=0 and count=1.
1 parent 2de0300 commit 731c005

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

spec/RestQuery.spec.js

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,4 +154,33 @@ describe('rest query', () => {
154154
});
155155
});
156156

157+
it('query with limit = 0', (done) => {
158+
rest.create(config, nobody, 'TestObject', {foo: 'baz'}
159+
).then(() => {
160+
return rest.create(config, nobody,
161+
'TestObject', {foo: 'qux'});
162+
}).then(() => {
163+
return rest.find(config, nobody,
164+
'TestObject', {}, {limit: 0});
165+
}).then((response) => {
166+
expect(response.results.length).toEqual(0);
167+
done();
168+
});
169+
});
170+
171+
it('query with limit = 0 and count = 1', (done) => {
172+
rest.create(config, nobody, 'TestObject', {foo: 'baz'}
173+
).then(() => {
174+
return rest.create(config, nobody,
175+
'TestObject', {foo: 'qux'});
176+
}).then(() => {
177+
return rest.find(config, nobody,
178+
'TestObject', {}, {limit: 0, count: 1});
179+
}).then((response) => {
180+
expect(response.results.length).toEqual(0);
181+
expect(response.count).toEqual(2);
182+
done();
183+
});
184+
});
185+
157186
});

0 commit comments

Comments
 (0)