Skip to content

Commit e885e40

Browse files
committed
Fix on size option & increase coverage
1 parent 859c86d commit e885e40

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

src/kuzzle.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1261,7 +1261,7 @@ Kuzzle.prototype.query = function (queryArgs, query, options, cb) {
12611261
object.from = options.from;
12621262
}
12631263

1264-
if (options.refresh) {
1264+
if (options.size) {
12651265
object.size = options.size;
12661266
}
12671267

test/kuzzle/query.test.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,22 @@ describe('Query management', function () {
172172
should(requestObject.refresh).match(refresh);
173173
});
174174

175+
it('should handle option size properly', function () {
176+
var
177+
size = 'foo';
178+
179+
kuzzle.query(queryArgs, { body: { some: 'query'}}, {size: size});
180+
should(requestObject.size).match(size);
181+
});
182+
183+
it('should handle option from properly', function () {
184+
var
185+
from = 'foo';
186+
187+
kuzzle.query(queryArgs, { body: { some: 'query'}}, {from: from});
188+
should(requestObject.from).match(from);
189+
});
190+
175191
it('should exit early if the query is not queuable and the SDK is offline', function () {
176192
kuzzle.state = 'offline';
177193
kuzzle.query(queryArgs, { body: { some: 'query'}}, {queuable: false});

0 commit comments

Comments
 (0)