Files
calendar/packages/lib/CalendarManager.test.ts
T
Keith WilliamsandGitHub 7180eb067a refactor: Move @calcom/core to @calcom/lib (#19655)
* refactor: Move @calcom/core to @calcom/lib

* Merging imports

* Clean up

* Ignoreing type error for now
2025-03-02 23:02:35 -03:00

40 lines
1.1 KiB
TypeScript

import { describe, expect, it } from "vitest";
import { getCalendarCredentials } from "./CalendarManager";
describe("CalendarManager tests", () => {
describe("fn: getCalendarCredentials", () => {
it("should only return credentials for calendar apps", async () => {
const googleCalendarCredentials = {
id: "1",
appId: "google-calendar",
type: "google_calendar",
userId: "3",
key: {
access_token: "google_calendar_key",
},
invalid: false,
delegatedTo: null,
};
const credentials = [
googleCalendarCredentials,
{
id: "2",
appId: "office365-video",
type: "office365_video",
userId: "4",
key: {
access_token: "office365_video_key",
},
invalid: false,
},
];
const calendarCredentials = getCalendarCredentials(credentials);
expect(calendarCredentials).toHaveLength(1);
expect(calendarCredentials[0].credential).toEqual(googleCalendarCredentials);
});
});
});