Fixing test case.

This commit is contained in:
Michael Drury 2020-11-12 17:41:50 +00:00
parent 2472168477
commit 0a73ab83db
2 changed files with 8 additions and 9 deletions

View File

@ -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)

View File

@ -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,
})
})