fix: resolve CalendarProvider type and jest mock typing in calendar sync tests

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
AdenMGBandCursor committed 2026-11-04 12:54:01 +10:30
1 parent 032dbab5f5
commit ec0503018d
2 files changed
+5 -4

No files matched your search

@@ -1,4 +1,4 @@
import { beforeEach, describe, expect, it } from "@jest/globals";
import { beforeEach, describe, expect, it, jest } from "@jest/globals";
import browser from "@/lib/browser";
import {
BSPLUS_CALENDAR_SYNC_IN_PROGRESS_KEY,
@@ -75,8 +75,9 @@ describe("calendar sync cross-tab lock", () => {
it("loses acquire when storage contains another tab's lockId after write", async () => {
const key = calendarSyncInProgressStorageKey("google");
const originalSet = browser.storage.local.set.getMockImplementation();
browser.storage.local.set.mockImplementation(async (items: Record<string, unknown>) => {
const setMock = jest.mocked(browser.storage.local.set);
const originalSet = setMock.getMockImplementation();
setMock.mockImplementation(async (items: Record<string, unknown>) => {
if (key in items) {
await originalSet?.({
[key]: {
+1 -1
View File
@@ -35,7 +35,7 @@ import type {
GoogleCalendarSyncResult,
} from "@/seqta/utils/googleCalendar/types";
export type { CalendarSyncProvider as CalendarProvider };
export type CalendarProvider = CalendarSyncProvider;
const MSG = {
accessToken: { google: "googleCalendarGetAccessToken", outlook: "outlookCalendarGetAccessToken" },