From 47bafeb5ddbf311634a3f0251f58e0473cf5cbc8 Mon Sep 17 00:00:00 2001 From: Pierre Lehnen <55164754+pierre-lehnen-rc@users.noreply.github.com> Date: Wed, 16 Oct 2024 20:32:21 -0300 Subject: [PATCH] chore: fix CI tests (#33617) * chore: fix CI tests * fix: lint --------- Co-authored-by: Rafael Tapia --- apps/meteor/ee/server/models/raw/LivechatRooms.ts | 11 ----------- apps/meteor/server/models/raw/LivechatRooms.ts | 11 +++++++++-- .../tests/end-to-end/api/livechat/09-visitors.ts | 1 - 3 files changed, 9 insertions(+), 14 deletions(-) diff --git a/apps/meteor/ee/server/models/raw/LivechatRooms.ts b/apps/meteor/ee/server/models/raw/LivechatRooms.ts index 2e4c8606d301..5b89704a522c 100644 --- a/apps/meteor/ee/server/models/raw/LivechatRooms.ts +++ b/apps/meteor/ee/server/models/raw/LivechatRooms.ts @@ -726,15 +726,4 @@ export class LivechatRoomsRawEE extends LivechatRoomsRaw implements ILivechatRoo ...extraQuery, }); } - - async setContactIdByVisitorIdOrToken(contactId: string, visitorId: string, visitorToken: string): Promise { - return this.updateMany( - { - 't': 'l', - '$or': [{ 'v._id': visitorId }, { 'v.token': visitorToken }], - 'v.contactId': { $exists: false }, - }, - { $set: { 'v.contactId': contactId } }, - ); - } } diff --git a/apps/meteor/server/models/raw/LivechatRooms.ts b/apps/meteor/server/models/raw/LivechatRooms.ts index 570ae5469a7d..f4f611cec6fc 100644 --- a/apps/meteor/server/models/raw/LivechatRooms.ts +++ b/apps/meteor/server/models/raw/LivechatRooms.ts @@ -2754,7 +2754,14 @@ export class LivechatRoomsRaw extends BaseRaw implements ILive throw new Error('Method not implemented.'); } - setContactIdByVisitorIdOrToken(_contactId: string, _visitorId: string, _visitorToken: string): Promise { - throw new Error('Method not implemented.'); + setContactIdByVisitorIdOrToken(contactId: string, visitorId: string, visitorToken: string): Promise { + return this.updateMany( + { + 't': 'l', + '$or': [{ 'v._id': visitorId }, { 'v.token': visitorToken }], + 'v.contactId': { $exists: false }, + }, + { $set: { 'v.contactId': contactId } }, + ); } } diff --git a/apps/meteor/tests/end-to-end/api/livechat/09-visitors.ts b/apps/meteor/tests/end-to-end/api/livechat/09-visitors.ts index 31134412b8ec..889f497bb209 100644 --- a/apps/meteor/tests/end-to-end/api/livechat/09-visitors.ts +++ b/apps/meteor/tests/end-to-end/api/livechat/09-visitors.ts @@ -56,7 +56,6 @@ describe('LIVECHAT - visitors', () => { expect(body).to.have.property('success', true); expect(body).to.have.property('visitor'); expect(body.visitor).to.have.property('token', 'test'); - expect(body.visitor).to.have.property('contactId'); // Ensure all new visitors are created as online :) expect(body.visitor).to.have.property('status', 'online');