Skip to content

Commit ab48b00

Browse files
committed
Added the whoAmI tests
1 parent 6f93f8b commit ab48b00

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

test/kuzzle/methods.test.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -542,4 +542,24 @@ describe('Kuzzle methods', function () {
542542
}
543543
});
544544
});
545+
546+
describe('#whoAmI', function () {
547+
it('should send the getCurrentUser after call', function () {
548+
var kuzzle;
549+
550+
this.timeout(200);
551+
552+
kuzzle = new Kuzzle('nowhere', {
553+
connect: 'manual'
554+
});
555+
556+
kuzzle.queuing = true;
557+
558+
kuzzle.whoAmI(function (err, res) {});
559+
560+
should(kuzzle.offlineQueue.length).be.exactly(1);
561+
should(kuzzle.offlineQueue[0].query.action).be.exactly('getCurrentUser');
562+
should(kuzzle.offlineQueue[0].query.controller).be.exactly('auth');
563+
});
564+
});
545565
});

0 commit comments

Comments
 (0)