mirror of
https://github.com/hanzoai/calendar.git
synced 2026-10-30 14:46:43 +00:00
* Add createdAt * Address feedback * Make date fields nullable * Type fixes * Type fix * Fix tests
84 lines
2.2 KiB
TypeScript
84 lines
2.2 KiB
TypeScript
import { CalendarsService } from "@/ee/calendars/services/calendars.service";
|
|
|
|
import { ICS_CALENDAR_ID, ICS_CALENDAR_TYPE } from "@calcom/platform-constants";
|
|
|
|
export class CalendarsServiceMock {
|
|
async getCalendars() {
|
|
return {
|
|
connectedCalendars: [
|
|
{
|
|
integration: {
|
|
installed: false,
|
|
type: "google_calendar",
|
|
title: "",
|
|
name: "",
|
|
description: "",
|
|
variant: "calendar",
|
|
slug: "",
|
|
locationOption: null,
|
|
categories: ["calendar"],
|
|
logo: "",
|
|
publisher: "",
|
|
url: "",
|
|
email: "",
|
|
},
|
|
credentialId: 1,
|
|
error: { message: "" },
|
|
},
|
|
{
|
|
integration: {
|
|
installed: false,
|
|
type: "office365_calendar",
|
|
title: "",
|
|
name: "",
|
|
description: "",
|
|
variant: "calendar",
|
|
slug: "",
|
|
locationOption: null,
|
|
categories: ["calendar"],
|
|
logo: "",
|
|
publisher: "",
|
|
url: "",
|
|
email: "",
|
|
},
|
|
credentialId: 2,
|
|
error: { message: "" },
|
|
},
|
|
{
|
|
integration: {
|
|
installed: false,
|
|
type: ICS_CALENDAR_TYPE,
|
|
title: "ics-feed_calendar",
|
|
name: "ics-feed_calendar",
|
|
description: "",
|
|
variant: "calendar",
|
|
slug: ICS_CALENDAR_ID,
|
|
locationOption: null,
|
|
categories: ["calendar"],
|
|
logo: "",
|
|
publisher: "",
|
|
url: "",
|
|
email: "",
|
|
},
|
|
credentialId: 2,
|
|
error: { message: "" },
|
|
},
|
|
],
|
|
destinationCalendar: {
|
|
name: "destinationCalendar",
|
|
eventTypeId: 1,
|
|
credentialId: 1,
|
|
primaryEmail: "primaryEmail",
|
|
integration: "google_calendar",
|
|
externalId: "externalId",
|
|
userId: null,
|
|
id: 0,
|
|
delegationCredentialId: null,
|
|
domainWideDelegationCredentialId: null,
|
|
createdAt: new Date(),
|
|
updatedAt: new Date(),
|
|
},
|
|
} satisfies Awaited<ReturnType<typeof CalendarsService.prototype.getCalendars>>;
|
|
}
|
|
}
|