Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 27 additions & 2 deletions apps/meteor/tests/end-to-end/api/livechat/10-departments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand All @@ -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'))
Expand Down
2 changes: 1 addition & 1 deletion packages/rest-typings/src/v1/omnichannel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,7 @@ const POSTLivechatDepartmentSchema = {
showOnOfflineForm: {
type: 'boolean',
},
requestTagsBeforeClosingChat: {
requestTagBeforeClosingChat: {
type: 'boolean',
nullable: true,
},
Expand Down
Loading