Fix flaky scim test

This commit is contained in:
Adria Navarro 2023-12-29 11:12:31 +01:00
parent a6537e66c3
commit fede6dc3e4
1 changed files with 10 additions and 3 deletions

View File

@ -1,6 +1,6 @@
import tk from "timekeeper"
import _ from "lodash"
import { mocks, structures } from "@budibase/backend-core/tests"
import { generator, mocks, structures } from "@budibase/backend-core/tests"
import {
ScimCreateUserRequest,
ScimGroupResponse,
@ -575,8 +575,15 @@ describe("scim", () => {
beforeAll(async () => {
groups = []
for (let i = 0; i < groupCount; i++) {
const body = structures.scim.createGroupRequest()
const groupNames = generator.unique(
() => generator.word(),
groupCount
)
for (const groupName of groupNames) {
const body = structures.scim.createGroupRequest({
displayName: groupName,
})
groups.push(await config.api.scimGroupsAPI.post({ body }))
}