|
|
|
|
@ -15,6 +15,7 @@ import { |
|
|
|
|
fetchInquiry, |
|
|
|
|
} from '../../../data/livechat/rooms'; |
|
|
|
|
import { updateEESetting, updatePermission, updateSetting } from '../../../data/permissions.helper'; |
|
|
|
|
import { pagination } from '../../../data/utils'; |
|
|
|
|
import { IS_EE } from '../../../e2e/config/constants'; |
|
|
|
|
|
|
|
|
|
(IS_EE ? describe : describe.skip)('[EE] LIVECHAT - dashboards', () => { |
|
|
|
|
@ -91,6 +92,12 @@ import { IS_EE } from '../../../e2e/config/constants'; |
|
|
|
|
expect(body.agents[0]).to.have.a.property('username'); |
|
|
|
|
expect(body.agents[0]).to.have.a.property('averageServiceTimeInSeconds').that.is.a('number'); |
|
|
|
|
}); |
|
|
|
|
it('should accept pagination', async () => { |
|
|
|
|
await pagination('livechat/analytics/agents/average-service-time', credentials, { |
|
|
|
|
start: new Date().toISOString(), |
|
|
|
|
end: new Date().toISOString(), |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
describe('livechat/analytics/agents/total-service-time', () => { |
|
|
|
|
it('should return an "unauthorized error" when the user does not have the necessary permission', async () => { |
|
|
|
|
@ -151,6 +158,12 @@ import { IS_EE } from '../../../e2e/config/constants'; |
|
|
|
|
expect(body.agents[0]).to.have.a.property('username'); |
|
|
|
|
expect(body.agents[0]).to.have.a.property('serviceTimeDuration').that.is.a('number'); |
|
|
|
|
}); |
|
|
|
|
it('should accept pagination', async () => { |
|
|
|
|
await pagination('livechat/analytics/agents/total-service-time', credentials, { |
|
|
|
|
start: new Date().toISOString(), |
|
|
|
|
end: new Date().toISOString(), |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
describe('livechat/analytics/agents/available-for-service-history', () => { |
|
|
|
|
it('should return an "unauthorized error" when the user does not have the necessary permission', async () => { |
|
|
|
|
@ -215,6 +228,12 @@ import { IS_EE } from '../../../e2e/config/constants'; |
|
|
|
|
expect(body.agents[0]).to.have.a.property('username'); |
|
|
|
|
expect(body.agents[0]).to.have.a.property('availableTimeInSeconds').that.is.a('number'); |
|
|
|
|
}); |
|
|
|
|
it('should accept pagination', async () => { |
|
|
|
|
await pagination('livechat/analytics/agents/available-for-service-history', credentials, { |
|
|
|
|
start: new Date().toISOString(), |
|
|
|
|
end: new Date().toISOString(), |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
describe('livechat/analytics/departments/amount-of-chats', () => { |
|
|
|
|
it('should return an "unauthorized error" when the user does not have the necessary permission', async () => { |
|
|
|
|
@ -274,6 +293,12 @@ import { IS_EE } from '../../../e2e/config/constants'; |
|
|
|
|
expect(body.departments[0]).to.have.a.property('rooms').that.is.a('number'); |
|
|
|
|
expect(body.departments[0]).to.have.a.property('_id'); |
|
|
|
|
}); |
|
|
|
|
it('should accept pagination', async () => { |
|
|
|
|
await pagination('livechat/analytics/departments/amount-of-chats', credentials, { |
|
|
|
|
start: new Date().toISOString(), |
|
|
|
|
end: new Date().toISOString(), |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
describe('livechat/analytics/departments/average-service-time', () => { |
|
|
|
|
it('should return an "unauthorized error" when the user does not have the necessary permission', async () => { |
|
|
|
|
@ -333,6 +358,12 @@ import { IS_EE } from '../../../e2e/config/constants'; |
|
|
|
|
expect(body.departments[0]).to.have.a.property('averageServiceTimeInSeconds').that.is.a('number'); |
|
|
|
|
expect(body.departments[0]).to.have.a.property('_id'); |
|
|
|
|
}); |
|
|
|
|
it('should accept pagination', async () => { |
|
|
|
|
await pagination('livechat/analytics/departments/average-service-time', credentials, { |
|
|
|
|
start: new Date().toISOString(), |
|
|
|
|
end: new Date().toISOString(), |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
describe('livechat/analytics/departments/average-chat-duration-time', () => { |
|
|
|
|
it('should return an "unauthorized error" when the user does not have the necessary permission', async () => { |
|
|
|
|
@ -392,6 +423,12 @@ import { IS_EE } from '../../../e2e/config/constants'; |
|
|
|
|
expect(body.departments[0]).to.have.a.property('averageChatDurationTimeInSeconds').that.is.a('number'); |
|
|
|
|
expect(body.departments[0]).to.have.a.property('_id'); |
|
|
|
|
}); |
|
|
|
|
it('should accept pagination', async () => { |
|
|
|
|
await pagination('livechat/analytics/departments/average-chat-duration-time', credentials, { |
|
|
|
|
start: new Date().toISOString(), |
|
|
|
|
end: new Date().toISOString(), |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
describe('livechat/analytics/departments/total-service-time', () => { |
|
|
|
|
it('should return an "unauthorized error" when the user does not have the necessary permission', async () => { |
|
|
|
|
@ -452,6 +489,12 @@ import { IS_EE } from '../../../e2e/config/constants'; |
|
|
|
|
expect(body.departments[0]).to.have.a.property('serviceTimeDuration').that.is.a('number'); |
|
|
|
|
expect(body.departments[0]).to.have.a.property('_id'); |
|
|
|
|
}); |
|
|
|
|
it('should accept pagination', async () => { |
|
|
|
|
await pagination('livechat/analytics/departments/total-service-time', credentials, { |
|
|
|
|
start: new Date().toISOString(), |
|
|
|
|
end: new Date().toISOString(), |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
describe('livechat/analytics/departments/average-waiting-time', () => { |
|
|
|
|
it('should return an "unauthorized error" when the user does not have the necessary permission', async () => { |
|
|
|
|
@ -511,6 +554,12 @@ import { IS_EE } from '../../../e2e/config/constants'; |
|
|
|
|
expect(body.departments[0]).to.have.a.property('averageWaitingTimeInSeconds').that.is.a('number'); |
|
|
|
|
expect(body.departments[0]).to.have.a.property('_id'); |
|
|
|
|
}); |
|
|
|
|
it('should accept pagination', async () => { |
|
|
|
|
await pagination('livechat/analytics/departments/average-waiting-time', credentials, { |
|
|
|
|
start: new Date().toISOString(), |
|
|
|
|
end: new Date().toISOString(), |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
describe('livechat/analytics/departments/total-transferred-chats', () => { |
|
|
|
|
it('should return an "unauthorized error" when the user does not have the necessary permission', async () => { |
|
|
|
|
@ -570,6 +619,12 @@ import { IS_EE } from '../../../e2e/config/constants'; |
|
|
|
|
expect(body.departments[0]).to.have.a.property('numberOfTransferredRooms').that.is.a('number'); |
|
|
|
|
expect(body.departments[0]).to.have.a.property('_id'); |
|
|
|
|
}); |
|
|
|
|
it('should accept pagination', async () => { |
|
|
|
|
await pagination('livechat/analytics/departments/total-transferred-chats', credentials, { |
|
|
|
|
start: new Date().toISOString(), |
|
|
|
|
end: new Date().toISOString(), |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
describe('livechat/analytics/departments/total-abandoned-chats', () => { |
|
|
|
|
it('should return an "unauthorized error" when the user does not have the necessary permission', async () => { |
|
|
|
|
@ -638,6 +693,12 @@ import { IS_EE } from '../../../e2e/config/constants'; |
|
|
|
|
expect(body.departments[0]).to.have.a.property('abandonedRooms').that.is.a('number'); |
|
|
|
|
expect(body.departments[0]).to.have.a.property('_id'); |
|
|
|
|
}); |
|
|
|
|
it('should accept pagination', async () => { |
|
|
|
|
await pagination('livechat/analytics/departments/total-abandoned-chats', credentials, { |
|
|
|
|
start: new Date().toISOString(), |
|
|
|
|
end: new Date().toISOString(), |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
describe('livechat/analytics/departments/percentage-abandoned-chats', () => { |
|
|
|
|
it('should return an "unauthorized error" when the user does not have the necessary permission', async () => { |
|
|
|
|
@ -699,5 +760,11 @@ import { IS_EE } from '../../../e2e/config/constants'; |
|
|
|
|
expect(body.departments[0]).to.have.a.property('percentageOfAbandonedChats').that.is.a('number'); |
|
|
|
|
expect(body.departments[0]).to.have.a.property('_id'); |
|
|
|
|
}); |
|
|
|
|
it('should accept pagination', async () => { |
|
|
|
|
await pagination('livechat/analytics/departments/percentage-abandoned-chats', credentials, { |
|
|
|
|
start: new Date().toISOString(), |
|
|
|
|
end: new Date().toISOString(), |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
|