|
|
|
|
@ -145,6 +145,7 @@ describe('LIVECHAT - rooms', () => { |
|
|
|
|
}); |
|
|
|
|
(IS_EE ? it : it.skip)('should prevent create a room for visitor if an app throws an error', async () => { |
|
|
|
|
// this test relies on the app installed by the insertApp fixture
|
|
|
|
|
// TODO: this visitor should be created on before block and deleted on after block
|
|
|
|
|
const visitor = await createVisitor(undefined, 'visitor prevent from app'); |
|
|
|
|
const { body } = await request.get(api('livechat/room')).query({ token: visitor.token }); |
|
|
|
|
|
|
|
|
|
@ -152,6 +153,7 @@ describe('LIVECHAT - rooms', () => { |
|
|
|
|
await deleteVisitor(visitor.token); |
|
|
|
|
}); |
|
|
|
|
it('should create a room for visitor', async () => { |
|
|
|
|
// TODO: this visitor should be created on before block and deleted on after block
|
|
|
|
|
const visitor = await createVisitor(); |
|
|
|
|
const { body } = await request.get(api('livechat/room')).query({ token: visitor.token }); |
|
|
|
|
|
|
|
|
|
@ -164,6 +166,7 @@ describe('LIVECHAT - rooms', () => { |
|
|
|
|
await deleteVisitor(visitor.token); |
|
|
|
|
}); |
|
|
|
|
it('should return an existing open room when visitor has one available', async () => { |
|
|
|
|
// TODO: this visitor should be created on before block and deleted on after block
|
|
|
|
|
const visitor = await createVisitor(); |
|
|
|
|
const { body } = await request.get(api('livechat/room')).query({ token: visitor.token }); |
|
|
|
|
|
|
|
|
|
@ -182,6 +185,7 @@ describe('LIVECHAT - rooms', () => { |
|
|
|
|
await deleteVisitor(visitor.token); |
|
|
|
|
}); |
|
|
|
|
it('should return a room for the visitor when rid points to a valid open room', async () => { |
|
|
|
|
// TODO: this visitor should be created on before block and deleted on after block
|
|
|
|
|
const visitor = await createVisitor(); |
|
|
|
|
const room = await createLivechatRoom(visitor.token); |
|
|
|
|
const { body } = await request.get(api('livechat/room')).query({ token: visitor.token, rid: room._id }); |
|
|
|
|
@ -194,6 +198,7 @@ describe('LIVECHAT - rooms', () => { |
|
|
|
|
await deleteVisitor(visitor.token); |
|
|
|
|
}); |
|
|
|
|
it('should properly read widget cookies', async () => { |
|
|
|
|
// TODO: this visitor should be created on before block and deleted on after block
|
|
|
|
|
const visitor = await createVisitor(); |
|
|
|
|
const { body } = await request |
|
|
|
|
.get(api('livechat/room')) |
|
|
|
|
|