Adding builder test case.
This commit is contained in:
parent
23e99ca4b7
commit
b2d7f24ff3
|
@ -38,8 +38,13 @@ beforeAll(async () => {
|
||||||
initUserGroupSync(updateCb)
|
initUserGroupSync(updateCb)
|
||||||
})
|
})
|
||||||
|
|
||||||
async function createUser(email: string, roles: UserRoles) {
|
async function createUser(email: string, roles: UserRoles, builder?: boolean) {
|
||||||
const user = await config.createUser({ email, roles })
|
const user = await config.createUser({
|
||||||
|
email,
|
||||||
|
roles,
|
||||||
|
builder: builder || false,
|
||||||
|
admin: false,
|
||||||
|
})
|
||||||
await context.doInContext(config.appId!, async () => {
|
await context.doInContext(config.appId!, async () => {
|
||||||
await events.user.created(user)
|
await events.user.created(user)
|
||||||
})
|
})
|
||||||
|
@ -123,4 +128,9 @@ describe("app user/group sync", () => {
|
||||||
await removeUserFromGroup()
|
await removeUserFromGroup()
|
||||||
await checkEmail(groupEmail, { notFound: true })
|
await checkEmail(groupEmail, { notFound: true })
|
||||||
})
|
})
|
||||||
|
|
||||||
|
it("should be able to handle builder users", async () => {
|
||||||
|
await createUser("test3@test.com", {}, true)
|
||||||
|
await checkEmail("test3@test.com")
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue