|
|
|
|
@ -52,28 +52,6 @@ describe('LIVECHAT - inquiries', () => { |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
describe('livechat/inquiries.queued', () => { |
|
|
|
|
it('should return an "unauthorized error" when the user does not have the necessary permission', async () => { |
|
|
|
|
await updatePermission('view-l-room', []); |
|
|
|
|
await request.get(api('livechat/inquiries.queued')).set(credentials).expect('Content-Type', 'application/json').expect(403); |
|
|
|
|
}); |
|
|
|
|
it('should return an array of inquiries', async () => { |
|
|
|
|
await updatePermission('view-l-room', ['admin']); |
|
|
|
|
await request |
|
|
|
|
.get(api('livechat/inquiries.queued')) |
|
|
|
|
.set(credentials) |
|
|
|
|
.expect('Content-Type', 'application/json') |
|
|
|
|
.expect(200) |
|
|
|
|
.expect((res: Response) => { |
|
|
|
|
expect(res.body).to.have.property('success', true); |
|
|
|
|
expect(res.body.inquiries).to.be.an('array'); |
|
|
|
|
expect(res.body).to.have.property('offset'); |
|
|
|
|
expect(res.body).to.have.property('total'); |
|
|
|
|
expect(res.body).to.have.property('count'); |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
describe('livechat/inquiries.getOne', () => { |
|
|
|
|
it('should return an "unauthorized error" when the user does not have the necessary permission', async () => { |
|
|
|
|
await updatePermission('view-l-room', []); |
|
|
|
|
@ -235,7 +213,7 @@ describe('LIVECHAT - inquiries', () => { |
|
|
|
|
}); |
|
|
|
|
it('should return an "unauthorized error" when the user does not have the necessary permission', async () => { |
|
|
|
|
await updatePermission('view-l-room', []); |
|
|
|
|
await request.get(api('livechat/inquiries.queued')).set(credentials).expect('Content-Type', 'application/json').expect(403); |
|
|
|
|
await request.get(api('livechat/inquiries.queuedForUser')).set(credentials).expect('Content-Type', 'application/json').expect(403); |
|
|
|
|
}); |
|
|
|
|
it('should return an array of inquiries', async () => { |
|
|
|
|
await restorePermissionToRoles('view-l-room'); |
|
|
|
|
|