Support username search in user listing api

This commit is contained in:
Johannes Zellner
2019-01-15 17:21:40 +01:00
parent 6d8fdb131f
commit 13fac3072d
4 changed files with 32 additions and 12 deletions

View File

@@ -523,7 +523,7 @@ describe('database', function () {
});
it('can get all with group ids paged', function (done) {
userdb.getAllWithGroupIdsPaged(1, 2, function (error, all) {
userdb.getAllWithGroupIdsPaged(null, 1, 2, function (error, all) {
expect(error).to.not.be.ok();
expect(all.length).to.equal(2);
@@ -537,7 +537,7 @@ describe('database', function () {
userCopy.groupIds = [];
expect(all[1]).to.eql(userCopy);
userdb.getAllWithGroupIdsPaged(2, 2, function (error, all) {
userdb.getAllWithGroupIdsPaged(null, 2, 2, function (error, all) {
expect(error).to.not.be.ok();
expect(all.length).to.equal(1);
@@ -552,6 +552,21 @@ describe('database', function () {
});
});
it('can get all with group ids paged and search', function (done) {
userdb.getAllWithGroupIdsPaged('id1', 1, 2, function (error, all) {
expect(error).to.not.be.ok();
expect(all.length).to.equal(1);
var userCopy;
userCopy = _.extend({}, USER_1);
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();