commit
7837eb4ffd
|
@ -353,14 +353,16 @@ export default class TestConfiguration {
|
||||||
roles?: UserRoles
|
roles?: UserRoles
|
||||||
} = {}
|
} = {}
|
||||||
): Promise<User> {
|
): Promise<User> {
|
||||||
let { id, firstName, lastName, email, builder, admin, roles } = user
|
const {
|
||||||
;(firstName = firstName || generator.first()),
|
id,
|
||||||
(lastName = lastName || generator.last()),
|
firstName = generator.first(),
|
||||||
(email = email || generator.email())
|
lastName = generator.last(),
|
||||||
roles = roles || {}
|
email = generator.email(),
|
||||||
if (builder == null) {
|
builder = true,
|
||||||
builder = true
|
admin,
|
||||||
}
|
roles,
|
||||||
|
} = user
|
||||||
|
|
||||||
const globalId = !id ? `us_${Math.random()}` : `us_${id}`
|
const globalId = !id ? `us_${Math.random()}` : `us_${id}`
|
||||||
const resp = await this.globalUser({
|
const resp = await this.globalUser({
|
||||||
id: globalId,
|
id: globalId,
|
||||||
|
@ -369,7 +371,7 @@ export default class TestConfiguration {
|
||||||
email,
|
email,
|
||||||
builder,
|
builder,
|
||||||
admin,
|
admin,
|
||||||
roles,
|
roles: roles || {},
|
||||||
})
|
})
|
||||||
await cache.user.invalidateUser(globalId)
|
await cache.user.invalidateUser(globalId)
|
||||||
return resp
|
return resp
|
||||||
|
|
Loading…
Reference in New Issue