Fix for 409 conflict which occurs in one of the user test cases - should stop it occurring in future.

This commit is contained in:
Michael Drury 2023-03-31 23:32:33 +01:00
parent 06cb5c3b37
commit d3e749d2de
1 changed files with 2 additions and 2 deletions

View File

@ -1,4 +1,4 @@
const { roles } = require("@budibase/backend-core") const { roles, utils } = require("@budibase/backend-core")
const { checkPermissionsEndpoint } = require("./utilities/TestFunctions") const { checkPermissionsEndpoint } = require("./utilities/TestFunctions")
const setup = require("./utilities") const setup = require("./utilities")
const { BUILTIN_ROLE_IDS } = roles const { BUILTIN_ROLE_IDS } = roles
@ -55,7 +55,7 @@ describe("/users", () => {
describe("update", () => { describe("update", () => {
it("should be able to update the user", async () => { it("should be able to update the user", async () => {
const user = await config.createUser({ id: `us_update${Math.random()}` }) const user = await config.createUser({ id: `us_update${utils.newid()}` })
user.roleId = BUILTIN_ROLE_IDS.BASIC user.roleId = BUILTIN_ROLE_IDS.BASIC
const res = await request const res = await request
.put(`/api/users/metadata`) .put(`/api/users/metadata`)