From 1c0767f549e4669574e8eef7f8f05625cabe4779 Mon Sep 17 00:00:00 2001 From: Pedro Silva Date: Fri, 2 Dec 2022 18:42:56 +0000 Subject: [PATCH] Add users with all roles --- .../config/internal-api/TestConfiguration/userManagement.ts | 5 +++-- qa-core/src/config/internal-api/fixtures/userManagement.ts | 6 ------ .../internal-api/userManagement/userManagement.spec.ts | 2 +- 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/qa-core/src/config/internal-api/TestConfiguration/userManagement.ts b/qa-core/src/config/internal-api/TestConfiguration/userManagement.ts index 17fe5e0b0f..0bc8fd7b66 100644 --- a/qa-core/src/config/internal-api/TestConfiguration/userManagement.ts +++ b/qa-core/src/config/internal-api/TestConfiguration/userManagement.ts @@ -63,8 +63,9 @@ export default class UserManagementApi { const response = await this.api.post(`/global/users/multi/invite`, { body }) const json = await response.json() expect(response).toHaveStatusCode(200) - expect(json.created.successful.length).toEqual(body.length) - expect(json.created.unsuccessful.length).toEqual(0) + expect(json.unsuccessful.length).toEqual(0) + expect(json.successful.length).toEqual(body.length) + return [response, json] } diff --git a/qa-core/src/config/internal-api/fixtures/userManagement.ts b/qa-core/src/config/internal-api/fixtures/userManagement.ts index 6ada85bb49..035f6162f1 100644 --- a/qa-core/src/config/internal-api/fixtures/userManagement.ts +++ b/qa-core/src/config/internal-api/fixtures/userManagement.ts @@ -65,12 +65,6 @@ export const generateInviteUser = (): Object[] => { return [{ email: `pedro+${randomId}@budibase.com`, userInfo: { - admin: { - global: true - }, - builder: { - global: true - }, userGroups: [] } }] diff --git a/qa-core/src/tests/internal-api/userManagement/userManagement.spec.ts b/qa-core/src/tests/internal-api/userManagement/userManagement.spec.ts index 62d27ec2a4..c18b6aaeff 100644 --- a/qa-core/src/tests/internal-api/userManagement/userManagement.spec.ts +++ b/qa-core/src/tests/internal-api/userManagement/userManagement.spec.ts @@ -26,7 +26,7 @@ describe("Internal API - User Management & Permissions", () => { const [devResponse, devData] = await config.userManagement.addUsers(generateDeveloper()) const [userResponse, userData] = await config.userManagement.addUsers(generateAppUser()) - const [invitedUserResponse, invitedUserData] = await config.userManagement.addUsers(generateInviteUser()) + const [invitedUserResponse, invitedUserData] = await config.userManagement.inviteUser(generateInviteUser()) const [allUsersResponse, allUsersData] = await config.userManagement.getAllUsers() expect(allUsersData.length).toEqual(4)