Skip to content

Commit

Permalink
Merge branch 'feat/single-contact-id' into feat/sci/contact-converter
Browse files Browse the repository at this point in the history
  • Loading branch information
pierre-lehnen-rc authored Oct 15, 2024
2 parents 7a480bb + e549453 commit 1121bb9
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ const modelsMock = {
},
LivechatRooms: {
findNewestByVisitorIdOrToken: sinon.stub(),
setContactIdByVisitorIdOrToken: sinon.stub(),
},
LivechatVisitors: {
findOneById: sinon.stub(),
Expand All @@ -43,7 +44,7 @@ const { validateCustomFields, validateContactManager, updateContact, getContact
},
});

describe('[OC] Contacts', () => {
describe.only('[OC] Contacts', () => {

Check failure on line 47 in apps/meteor/tests/unit/app/livechat/server/lib/Contacts.spec.ts

View workflow job for this annotation

GitHub Actions / 🔎 Code Check / Code Lint

'describe.only' is restricted from being used
describe('validateCustomFields', () => {
const mockCustomFields = [{ _id: 'cf1', label: 'Custom Field 1', regexp: '^[0-9]+$', required: true }];

Expand Down Expand Up @@ -185,8 +186,8 @@ describe('[OC] Contacts', () => {
expect(await getContact('any_id')).to.be.deep.equal({
_id: 'any_id',
name: 'VisitorName',
emails: ['[email protected]', '[email protected]'],
phones: ['1', '2'],
emails: [{ address: '[email protected]' }, { address: '[email protected]' }],
phones: [{ phoneNumber: '1' }, { phoneNumber: '2' }],
contactManager: 'manager_id',
unknown: true,
channels: [
Expand All @@ -205,8 +206,6 @@ describe('[OC] Contacts', () => {
expect(modelsMock.LivechatContacts.findOneById.getCall(0).returnValue).to.be.equal(null);
expect(modelsMock.LivechatContacts.findOneById.getCall(1).args[0]).to.be.equal('any_id');
expect(modelsMock.LivechatContacts.findOneById.getCall(1).returnValue).to.be.equal(createdContact);
expect(modelsMock.LivechatVisitors.updateById.getCall(0).args[0]).to.be.equal('any_id');
expect(modelsMock.LivechatVisitors.updateById.getCall(0).args[1]).to.be.deep.equal({ $set: { contactId: 'any_id' } });

expect(modelsMock.LivechatContacts.insertOne.getCall(0)).to.be.null;
expect(modelsMock.Users.findOneByUsername.getCall(0).args[0]).to.be.equal('username');
Expand Down

0 comments on commit 1121bb9

Please sign in to comment.