Add paginated user listing on the db level

This commit is contained in:
Johannes Zellner
2019-01-14 16:08:55 +01:00
parent 898f1dd151
commit 05f07b1f47
2 changed files with 55 additions and 0 deletions

View File

@@ -522,6 +522,36 @@ describe('database', function () {
});
});
it('can get all with group ids paged', function (done) {
userdb.getAllWithGroupIdsPaged(1, 2, function (error, all) {
expect(error).to.not.be.ok();
expect(all.length).to.equal(2);
var userCopy;
userCopy = _.extend({}, USER_0);
userCopy.groupIds = [];
expect(all[0]).to.eql(userCopy);
userCopy = _.extend({}, USER_1);
userCopy.groupIds = [];
expect(all[1]).to.eql(userCopy);
userdb.getAllWithGroupIdsPaged(2, 2, function (error, all) {
expect(error).to.not.be.ok();
expect(all.length).to.equal(1);
var userCopy;
userCopy = _.extend({}, USER_2);
userCopy.groupIds = [];
expect(all[0]).to.eql(userCopy);
done();
});
});
});
it('can get all admins', function (done) {
userdb.getAllAdmins(function (error, all) {
expect(error).to.not.be.ok();