Fixing CalendarService tests (#3993)

pull/3844/head^2
Leo Giovanetti 2022-08-26 20:21:12 -03:00 committed by GitHub
parent d1c5268ef0
commit cfe7c7a5b3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 7 deletions

View File

@ -3,7 +3,7 @@ import {
getCloseComContactIds,
getCustomActivityTypeInstanceData,
getCloseComCustomActivityTypeFieldsIds,
getCloseComGenericLeadId,
getCloseComLeadId,
} from "@calcom/lib/CloseComeUtils";
import { CalendarEvent } from "@calcom/types/Calendar";
@ -19,7 +19,7 @@ afterEach(() => {
jest.resetAllMocks();
});
// getCloseComGenericLeadId
// getCloseComLeadId
test("check generic lead generator: already exists", async () => {
CloseCom.prototype.lead = {
list: () => ({
@ -28,11 +28,11 @@ test("check generic lead generator: already exists", async () => {
} as any;
const closeCom = new CloseCom("someKey");
const id = await getCloseComGenericLeadId(closeCom);
const id = await getCloseComLeadId(closeCom);
expect(id).toEqual("abc");
});
// getCloseComGenericLeadId
// getCloseComLeadId
test("check generic lead generator: doesn't exist", async () => {
CloseCom.prototype.lead = {
list: () => ({
@ -42,7 +42,7 @@ test("check generic lead generator: doesn't exist", async () => {
} as any;
const closeCom = new CloseCom("someKey");
const id = await getCloseComGenericLeadId(closeCom);
const id = await getCloseComLeadId(closeCom);
expect(id).toEqual("def");
});
@ -62,7 +62,7 @@ test("retrieve contact IDs: all exist", async () => {
} as any;
const closeCom = new CloseCom("someKey");
const contactIds = await getCloseComContactIds(event.attendees, "leadId", closeCom);
const contactIds = await getCloseComContactIds(event.attendees, closeCom, "leadId");
expect(contactIds).toEqual(["test1", "test2"]);
});
@ -80,7 +80,7 @@ test("retrieve contact IDs: some don't exist", async () => {
} as any;
const closeCom = new CloseCom("someKey");
const contactIds = await getCloseComContactIds(event.attendees, "leadId", closeCom);
const contactIds = await getCloseComContactIds(event.attendees, closeCom, "leadId");
expect(contactIds).toEqual(["test1", "test3"]);
});