test: add ldap group test

This commit is contained in:
Girish Ramakrishnan
2024-02-28 14:25:07 +01:00
parent 26dad82cd3
commit f98fe43843
2 changed files with 15 additions and 5 deletions
-2
View File
@@ -61,8 +61,6 @@ async function setName(req, res, next) {
async function setMembers(req, res, next) {
assert.strictEqual(typeof req.resource, 'object');
if (req.resource.source === 'ldap') return next(new HttpError(409, 'members of an external group cannot be set'));
if (!req.body.userIds) return next(new HttpError(404, 'missing or invalid userIds fields'));
if (!Array.isArray(req.body.userIds)) return next(new HttpError(404, 'userIds must be an array'));
if (req.body.userIds.some((u) => typeof u !== 'string')) return next(new HttpError(400, 'userIds array must contain strings'));