chore: Livechat department incorrect param name (#35455)

pull/35716/head^2
Aleksander Nicacio da Silva 11 months ago committed by GitHub
parent 2ee1a81de7
commit ba78cbe2f2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 29
      apps/meteor/tests/end-to-end/api/livechat/10-departments.ts
  2. 2
      packages/rest-typings/src/v1/omnichannel.ts

@ -222,7 +222,7 @@ import { IS_EE } from '../../../e2e/config/constants';
.expect(400);
});
it('should return an error if requestTagsBeforeClosing is true but no tags are provided', async () => {
it('should return an error if requestTagBeforeClosing is true but no tags are provided', async () => {
await request
.post(api('livechat/department'))
.set(credentials)
@ -240,7 +240,7 @@ import { IS_EE } from '../../../e2e/config/constants';
.expect(400);
});
it('should return an error if requestTagsBeforeClosing is true but tags are not an array', async () => {
it('should return an error if requestTagBeforeClosing is true but tags are not an array', async () => {
await request
.post(api('livechat/department'))
.set(credentials)
@ -259,6 +259,31 @@ import { IS_EE } from '../../../e2e/config/constants';
.expect(400);
});
it('should create department if requestTagBeforeClosing is true and tags are an array', async () => {
const chatClosingTags = ['tagA', 'tagB'];
const { body } = await request
.post(api('livechat/department'))
.set(credentials)
.send({
department: {
name: 'Test',
enabled: true,
showOnOfflineForm: true,
showOnRegistration: true,
email: 'bla@bla',
requestTagBeforeClosingChat: true,
chatClosingTags,
},
})
.expect('Content-Type', 'application/json')
.expect(200);
expect(body.department).to.have.property('requestTagBeforeClosingChat', true);
expect(body.department.chatClosingTags).to.deep.equal(chatClosingTags);
await deleteDepartment(body.department._id);
});
it('should return an error if fallbackForwardDepartment is present but is not a department id', async () => {
await request
.post(api('livechat/department'))

@ -590,7 +590,7 @@ const POSTLivechatDepartmentSchema = {
showOnOfflineForm: {
type: 'boolean',
},
requestTagsBeforeClosingChat: {
requestTagBeforeClosingChat: {
type: 'boolean',
nullable: true,
},

Loading…
Cancel
Save