add a test to check if use has a pending status after creation
This commit is contained in:
committed by
Jackson Harper
parent
b98f7c6ba2
commit
b52043bd95
@ -71,7 +71,8 @@ export const deleteTestUser = async (name: string) => {
|
||||
export const createTestUser = async (
|
||||
name: string,
|
||||
invite?: string | undefined,
|
||||
password?: string
|
||||
password?: string,
|
||||
pendingConfirmation?: boolean
|
||||
): Promise<User> => {
|
||||
const [newUser] = await createUser({
|
||||
provider: 'GOOGLE',
|
||||
@ -82,6 +83,7 @@ export const createTestUser = async (
|
||||
name: name,
|
||||
inviteCode: invite,
|
||||
password: password,
|
||||
pendingConfirmation,
|
||||
})
|
||||
|
||||
return newUser
|
||||
|
||||
@ -12,6 +12,7 @@ import {
|
||||
getUserFollowers,
|
||||
getUserFollowing,
|
||||
} from '../../src/services/followers'
|
||||
import { StatusType } from '../../src/datalayer/user/model'
|
||||
|
||||
describe('create a user with an invite', () => {
|
||||
it('follows the other user in the group', async () => {
|
||||
@ -51,3 +52,16 @@ describe('create a user with an invite', () => {
|
||||
expect(profile).to.exist
|
||||
})
|
||||
})
|
||||
|
||||
describe('create a pending user', () => {
|
||||
it('creates a pending user', async () => {
|
||||
after(async () => {
|
||||
await deleteTestUser(name)
|
||||
})
|
||||
|
||||
const name = 'pendingUser'
|
||||
const user = await createTestUser(name, undefined, undefined, true)
|
||||
|
||||
expect(user.status).to.equal(StatusType.Pending)
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user