chore: Salesforce - optimize getContact method [CAL-4940] (#18289)

Co-authored-by: Udit Takkar <[email protected]>
This commit is contained in:
Joe Au-YeungandUdit Takkar authored and GitHub committed 2025-01-09 12:14:49 -07:00
1 parent b6bd0eda43
commit a22fd0c151
4 files changed
+129 -169

No files matched your search

@@ -166,6 +166,13 @@ describe("getTeamMemberEmailForResponseOrContactUsingUrlQuery", () => {
schedulingType: SchedulingType.ROUND_ROBIN,
metadata: null,
length: 30,
hosts: [
{
user: {
email: "[email protected]",
},
},
],
};
it("should return null when email is not provided in query", async () => {
@@ -235,7 +242,7 @@ describe("getTeamMemberEmailForResponseOrContactUsingUrlQuery", () => {
});
it("should return null when CRM owner is not part of event type", async () => {
const ownerEmail = "[email protected]";
const ownerEmail = "ownerNotInEventType@example.com";
const bookerEmail = "[email protected]";
mockGetCRMContactOwnerForRRLeadSkip({ bookerEmail, teamMemberEmail: ownerEmail });
@@ -331,7 +338,7 @@ describe("getTeamMemberEmailForResponseOrContactUsingUrlQuery", () => {
it("should return null when when cal.routingFormResponseId and cal.salesforce.xxxx=true is provided but the returned email isn't an event member", async () => {
const bookerEmail = "[email protected]";
const teamMemberEmail = "[email protected]";
const teamMemberEmail = "ownerNotInEventType@example.com";
mockBookingFormHandler({ bookerEmail, teamMemberEmail });
const SOME_OTHER_EVENT_ID = 200;
await createHostForEvent({
@@ -92,6 +92,7 @@ export const getServerSideProps = async (context: GetServerSidePropsContext) =>
select: {
name: true,
username: true,
email: true,
},
},
},