mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-13 07:46:06 +00:00
add test for room creation with existing user id
This commit is contained in:
parent
66652cf74e
commit
3a95e25e1c
@ -71,6 +71,8 @@ describe('Room', () => {
|
||||
})
|
||||
|
||||
describe('authenticated', () => {
|
||||
let roomId: string
|
||||
|
||||
beforeAll(async () => {
|
||||
authenticatedUser = await chattingUser.toJson()
|
||||
})
|
||||
@ -92,6 +94,26 @@ describe('Room', () => {
|
||||
})
|
||||
|
||||
describe('user id exists', () => {
|
||||
it('returns the id of the room', async () => {
|
||||
const result = await mutate({
|
||||
mutation: createRoomMutation(),
|
||||
variables: {
|
||||
userId: 'other-chatting-user',
|
||||
},
|
||||
})
|
||||
roomId = result.data.CreateRoom.id
|
||||
await expect(result).toMatchObject({
|
||||
errors: undefined,
|
||||
data: {
|
||||
CreateRoom: {
|
||||
id: expect.any(String),
|
||||
},
|
||||
},
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
describe('create room with same user id', () => {
|
||||
it('returns the id of the room', async () => {
|
||||
await expect(mutate({
|
||||
mutation: createRoomMutation(),
|
||||
@ -102,7 +124,7 @@ describe('Room', () => {
|
||||
errors: undefined,
|
||||
data: {
|
||||
CreateRoom: {
|
||||
id: expect.any(String),
|
||||
id: roomId,
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user