diff --git a/packages/server/src/api/routes/tests/role.spec.js b/packages/server/src/api/routes/tests/role.spec.js index 5282597897..a6418c2277 100644 --- a/packages/server/src/api/routes/tests/role.spec.js +++ b/packages/server/src/api/routes/tests/role.spec.js @@ -1,5 +1,6 @@ const { roles, events, permissions } = require("@budibase/backend-core") const setup = require("./utilities") +const { PermissionLevel } = require("@budibase/types") const { basicRole } = setup.structures const { BUILTIN_ROLE_IDS } = roles const { BuiltinPermissionID } = permissions @@ -16,7 +17,7 @@ describe("/roles", () => { const createRole = async (role) => { if (!role) { - role = basicRole() + role = basicRole() } return request @@ -98,7 +99,7 @@ describe("/roles", () => { it("should be able to get the role with a permission added", async () => { const table = await config.createTable() - await config.addPermission(BUILTIN_ROLE_IDS.POWER, table._id) + await config.api.permission.set({ roleId: BUILTIN_ROLE_IDS.POWER, resourceId: table._id, level: PermissionLevel.READ }) const res = await request .get(`/api/roles`) .set(config.defaultHeaders())