Fixing CalendarService tests (#3993)
parent
d1c5268ef0
commit
cfe7c7a5b3
|
@ -3,7 +3,7 @@ import {
|
||||||
getCloseComContactIds,
|
getCloseComContactIds,
|
||||||
getCustomActivityTypeInstanceData,
|
getCustomActivityTypeInstanceData,
|
||||||
getCloseComCustomActivityTypeFieldsIds,
|
getCloseComCustomActivityTypeFieldsIds,
|
||||||
getCloseComGenericLeadId,
|
getCloseComLeadId,
|
||||||
} from "@calcom/lib/CloseComeUtils";
|
} from "@calcom/lib/CloseComeUtils";
|
||||||
import { CalendarEvent } from "@calcom/types/Calendar";
|
import { CalendarEvent } from "@calcom/types/Calendar";
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@ afterEach(() => {
|
||||||
jest.resetAllMocks();
|
jest.resetAllMocks();
|
||||||
});
|
});
|
||||||
|
|
||||||
// getCloseComGenericLeadId
|
// getCloseComLeadId
|
||||||
test("check generic lead generator: already exists", async () => {
|
test("check generic lead generator: already exists", async () => {
|
||||||
CloseCom.prototype.lead = {
|
CloseCom.prototype.lead = {
|
||||||
list: () => ({
|
list: () => ({
|
||||||
|
@ -28,11 +28,11 @@ test("check generic lead generator: already exists", async () => {
|
||||||
} as any;
|
} as any;
|
||||||
|
|
||||||
const closeCom = new CloseCom("someKey");
|
const closeCom = new CloseCom("someKey");
|
||||||
const id = await getCloseComGenericLeadId(closeCom);
|
const id = await getCloseComLeadId(closeCom);
|
||||||
expect(id).toEqual("abc");
|
expect(id).toEqual("abc");
|
||||||
});
|
});
|
||||||
|
|
||||||
// getCloseComGenericLeadId
|
// getCloseComLeadId
|
||||||
test("check generic lead generator: doesn't exist", async () => {
|
test("check generic lead generator: doesn't exist", async () => {
|
||||||
CloseCom.prototype.lead = {
|
CloseCom.prototype.lead = {
|
||||||
list: () => ({
|
list: () => ({
|
||||||
|
@ -42,7 +42,7 @@ test("check generic lead generator: doesn't exist", async () => {
|
||||||
} as any;
|
} as any;
|
||||||
|
|
||||||
const closeCom = new CloseCom("someKey");
|
const closeCom = new CloseCom("someKey");
|
||||||
const id = await getCloseComGenericLeadId(closeCom);
|
const id = await getCloseComLeadId(closeCom);
|
||||||
expect(id).toEqual("def");
|
expect(id).toEqual("def");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -62,7 +62,7 @@ test("retrieve contact IDs: all exist", async () => {
|
||||||
} as any;
|
} as any;
|
||||||
|
|
||||||
const closeCom = new CloseCom("someKey");
|
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"]);
|
expect(contactIds).toEqual(["test1", "test2"]);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -80,7 +80,7 @@ test("retrieve contact IDs: some don't exist", async () => {
|
||||||
} as any;
|
} as any;
|
||||||
|
|
||||||
const closeCom = new CloseCom("someKey");
|
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"]);
|
expect(contactIds).toEqual(["test1", "test3"]);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue