diff --git a/packages/server/src/api/routes/tests/couchTestUtils.js b/packages/server/src/api/routes/tests/couchTestUtils.js index a3d01bfc6b..ec86c8b707 100644 --- a/packages/server/src/api/routes/tests/couchTestUtils.js +++ b/packages/server/src/api/routes/tests/couchTestUtils.js @@ -216,13 +216,10 @@ exports.testPermissionsForEndpoint = async ({ url, body, appId, - permissionName, + permName1, + permName2, }) => { - const headers = await createUserWithOnePermission( - request, - appId, - permissionName - ) + const headers = await createUserWithOnePermission(request, appId, permName1) await createRequest(request, method, url, body) .set(headers) @@ -231,7 +228,7 @@ exports.testPermissionsForEndpoint = async ({ const noPermsHeaders = await createUserWithAllPermissionExceptOne( request, appId, - permissionName + permName2 ) await createRequest(request, method, url, body) diff --git a/packages/server/src/api/routes/tests/user.spec.js b/packages/server/src/api/routes/tests/user.spec.js index bd77c179b1..2862903d57 100644 --- a/packages/server/src/api/routes/tests/user.spec.js +++ b/packages/server/src/api/routes/tests/user.spec.js @@ -54,7 +54,8 @@ describe("/users", () => { method: "GET", url: `/api/users`, appId: appId, - permissionName: BUILTIN_PERMISSION_NAMES.WRITE, + permName1: BUILTIN_PERMISSION_NAMES.POWER, + permName2: BUILTIN_PERMISSION_NAMES.WRITE, }) }) @@ -81,7 +82,8 @@ describe("/users", () => { body: { name: "brandNewUser", username: "brandNewUser", password: "yeeooo", accessLevelId: BUILTIN_LEVELS.power._id }, url: `/api/users`, appId: appId, - permissionName: BUILTIN_PERMISSION_NAMES.WRITE, + permName1: BUILTIN_PERMISSION_NAMES.ADMIN, + permName2: BUILTIN_PERMISSION_NAMES.POWER, }) })