Skip to content

Scheduling infrastructure for absolutely everyone.

chore: Added unit tests for CalendarManager->getCalendarCredentials (#9618)

Keith Williamscbf3edefc7a6
diff --git a/packages/core/CalendarManager.test.ts b/packages/core/CalendarManager.test.ts
new file mode 100644
index 00000000000..1ded71a905b
--- /dev/null
+++ b/packages/core/CalendarManager.test.ts
@@ -0,0 +1,35 @@
+import { describe, expect, it } from "vitest";
+
+import { getCalendarCredentials } from "./CalendarManager";
+
+describe("CalendarManager tests", () => {
+ describe("fn: getCalendarCredentials", () => {
+ it("should only return credentials for calendar apps", () => {
+ const googleCalendarCredentials = {
+ id: "1",
+ appId: "google-calendar",
+ type: "google_calendar",
+ userId: "3",
+ key: {
+ access_token: "google_calendar_key"
+ },
+ invalid: false
+ };
+
+ 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).toBe(googleCalendarCredentials);
+ });
+ });
+});