Revert "fix: invalid Cancelled / Rescheduled downstream calendar block (#14700)" (#14800)

This reverts commit 0306ad737f.
This commit is contained in:
Alex van Andel authored and GitHub committed 2024-04-29 13:31:02 -03:00
1 parent ad0b8a668c
commit 22425bb693
4 files changed
+114 -54

No files matched your search

@@ -2433,7 +2433,13 @@ describe("handleNewBooking", () => {
email: "[email protected]",
id: 101,
schedules: [TestData.schedules.IstWorkHours],
credentials: [],
credentials: [getGoogleCalendarCredential()],
selectedCalendars: [TestData.selectedCalendars.google],
destinationCalendar: {
integration: "google_calendar",
externalId: "[email protected]",
primaryEmail: organizerOtherEmail,
},
});
await createBookingScenario(
@@ -2449,10 +2455,15 @@ describe("handleNewBooking", () => {
id: 101,
},
],
destinationCalendar: {
integration: "google_calendar",
externalId: "[email protected]",
primaryEmail: organizerDestinationCalendarEmailOnEventType,
},
},
],
organizer,
apps: [TestData.apps["daily-video"]],
apps: [TestData.apps["google-calendar"], TestData.apps["daily-video"]],
})
);
@@ -2513,10 +2524,36 @@ describe("handleNewBooking", () => {
meetingPassword: "MOCK_PASS",
meetingUrl: "http://mock-dailyvideo.example.com/meeting-1",
},
{
type: appStoreMetadata.googlecalendar.type,
uid: "MOCKED_GOOGLE_CALENDAR_EVENT_ID",
meetingId: "MOCKED_GOOGLE_CALENDAR_EVENT_ID",
meetingPassword: "MOCK_PASSWORD",
meetingUrl: "https://UNUSED_URL",
},
],
iCalUID: createdBooking.iCalUID,
});
expectSuccessfulCalendarEventCreationInCalendar(calendarMock, {
calendarId: "[email protected]",
videoCallUrl: "http://mock-dailyvideo.example.com/meeting-1",
});
const iCalUID = expectICalUIDAsString(createdBooking.iCalUID);
expectSuccessfulBookingCreationEmails({
booking: {
uid: createdBooking.uid!,
urlOrigin: WEBSITE_URL,
},
booker,
organizer,
emails,
iCalUID,
destinationEmail: organizerDestinationCalendarEmailOnEventType,
});
await expect(async () => await handleNewBooking(req)).rejects.toThrowError(
ErrorCode.NoAvailableUsersFound
);
@@ -266,8 +266,12 @@ describe("handleNewBooking", () => {
email: "[email protected]",
id: 101,
schedules: [TestData.schedules.IstWorkHours],
credentials: [],
selectedCalendars: [],
credentials: [getGoogleCalendarCredential()],
selectedCalendars: [TestData.selectedCalendars.google],
destinationCalendar: {
integration: "google_calendar",
externalId: "[email protected]",
},
});
const recurrence = getRecurrence({
@@ -299,6 +303,10 @@ describe("handleNewBooking", () => {
id: 101,
},
],
destinationCalendar: {
integration: "google_calendar",
externalId: "[email protected]",
},
},
],
bookings: [
@@ -312,7 +320,7 @@ describe("handleNewBooking", () => {
},
],
organizer,
apps: [TestData.apps["daily-video"]],
apps: [TestData.apps["google-calendar"], TestData.apps["daily-video"]],
})
);
@@ -829,7 +837,12 @@ describe("handleNewBooking", () => {
],
// Has morning shift with some overlap with morning shift
schedules: [TestData.schedules.IstMorningShift],
credentials: [],
credentials: [getGoogleCalendarCredential()],
selectedCalendars: [TestData.selectedCalendars.google],
destinationCalendar: {
integration: TestData.apps["google-calendar"].type,
externalId: "[email protected]",
},
});
const otherTeamMembers = [
@@ -843,7 +856,12 @@ describe("handleNewBooking", () => {
id: 102,
// Has Evening shift
schedules: [TestData.schedules.IstMorningShift],
credentials: [],
credentials: [getGoogleCalendarCredential()],
selectedCalendars: [TestData.selectedCalendars.google],
destinationCalendar: {
integration: TestData.apps["google-calendar"].type,
externalId: "[email protected]",
},
},
];
@@ -883,6 +901,10 @@ describe("handleNewBooking", () => {
isFixed: true,
},
],
destinationCalendar: {
integration: "google_calendar",
externalId: "[email protected]",
},
},
],
bookings: [
@@ -901,7 +923,7 @@ describe("handleNewBooking", () => {
],
organizer,
usersApartFromOrganizer: otherTeamMembers,
apps: [TestData.apps["daily-video"]],
apps: [TestData.apps["google-calendar"], TestData.apps["daily-video"]],
})
);
@@ -914,6 +936,13 @@ describe("handleNewBooking", () => {
},
});
const calendarMock = mockCalendarToHaveNoBusySlots("googlecalendar", {
create: {
id: "MOCKED_GOOGLE_CALENDAR_EVENT_ID",
iCalUID: "MOCKED_GOOGLE_CALENDAR_ICS_ID",
},
});
const recurringCountInRequest = 4;
const mockBookingData1 = getMockRequestDataForBooking({
data: {