Add users with all roles

This commit is contained in:
Pedro Silva 2022-12-02 18:42:56 +00:00
parent b9186cac9d
commit 1c0767f549
3 changed files with 4 additions and 9 deletions

View File

@ -63,8 +63,9 @@ export default class UserManagementApi {
const response = await this.api.post(`/global/users/multi/invite`, { body }) const response = await this.api.post(`/global/users/multi/invite`, { body })
const json = await response.json() const json = await response.json()
expect(response).toHaveStatusCode(200) expect(response).toHaveStatusCode(200)
expect(json.created.successful.length).toEqual(body.length) expect(json.unsuccessful.length).toEqual(0)
expect(json.created.unsuccessful.length).toEqual(0) expect(json.successful.length).toEqual(body.length)
return [response, json] return [response, json]
} }

View File

@ -65,12 +65,6 @@ export const generateInviteUser = (): Object[] => {
return [{ return [{
email: `pedro+${randomId}@budibase.com`, email: `pedro+${randomId}@budibase.com`,
userInfo: { userInfo: {
admin: {
global: true
},
builder: {
global: true
},
userGroups: [] userGroups: []
} }
}] }]

View File

@ -26,7 +26,7 @@ describe("Internal API - User Management & Permissions", () => {
const [devResponse, devData] = await config.userManagement.addUsers(generateDeveloper()) const [devResponse, devData] = await config.userManagement.addUsers(generateDeveloper())
const [userResponse, userData] = await config.userManagement.addUsers(generateAppUser()) 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() const [allUsersResponse, allUsersData] = await config.userManagement.getAllUsers()
expect(allUsersData.length).toEqual(4) expect(allUsersData.length).toEqual(4)