Skip to content

Commit 859c86d

Browse files
committed
Align unit tests
1 parent 0216976 commit 859c86d

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

test/kuzzle/methods.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -345,12 +345,12 @@ describe('Kuzzle methods', function () {
345345
});
346346

347347
it('should handle from option correctly', function (done) {
348-
expectedQuery.body.from = 'foobar';
348+
expectedQuery.from = 'foobar';
349349
kuzzle.listCollections('foo', {from: 'foobar'}, () => done());
350350
});
351351

352352
it('should handle size option correctly', function (done) {
353-
expectedQuery.body.size = 'foobar';
353+
expectedQuery.size = 'foobar';
354354
kuzzle.listCollections('foo', {size: 'foobar'}, () => done());
355355
});
356356

test/kuzzleDataCollection/methods.test.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -507,6 +507,13 @@ describe('KuzzleDataCollection methods', function () {
507507
beforeEach(function () {
508508
kuzzle = new Kuzzle('foo', {defaultIndex: 'bar'});
509509
emitted = false;
510+
expectedQuery = {
511+
index: 'bar',
512+
collection: 'foo',
513+
action: 'get',
514+
controller: 'document',
515+
body: {}
516+
};
510517
});
511518

512519
it('should forward the query to the advancedSearch method', function () {
@@ -549,7 +556,7 @@ describe('KuzzleDataCollection methods', function () {
549556

550557
collection.fetchAllDocuments({from: 123, size: 456}, function () {});
551558
should(stub.calledOnce).be.true();
552-
should(stub.calledWithMatch({from: 123, size: 456})).be.true();
559+
should(stub.calledWithMatch({}, {from: 123, size: 456})).be.true();
553560
stub.restore();
554561
});
555562
});

0 commit comments

Comments
 (0)