mirror of
https://github.com/BetterSEQTA/BetterSEQTA-Plus.git
synced 2026-12-06 19:56:45 +10:30
fix: resolve CalendarProvider type and jest mock typing in calendar sync tests
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
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 browser from "@/lib/browser";
|
||||||
import {
|
import {
|
||||||
BSPLUS_CALENDAR_SYNC_IN_PROGRESS_KEY,
|
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 () => {
|
it("loses acquire when storage contains another tab's lockId after write", async () => {
|
||||||
const key = calendarSyncInProgressStorageKey("google");
|
const key = calendarSyncInProgressStorageKey("google");
|
||||||
const originalSet = browser.storage.local.set.getMockImplementation();
|
const setMock = jest.mocked(browser.storage.local.set);
|
||||||
browser.storage.local.set.mockImplementation(async (items: Record<string, unknown>) => {
|
const originalSet = setMock.getMockImplementation();
|
||||||
|
setMock.mockImplementation(async (items: Record<string, unknown>) => {
|
||||||
if (key in items) {
|
if (key in items) {
|
||||||
await originalSet?.({
|
await originalSet?.({
|
||||||
[key]: {
|
[key]: {
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ import type {
|
|||||||
GoogleCalendarSyncResult,
|
GoogleCalendarSyncResult,
|
||||||
} from "@/seqta/utils/googleCalendar/types";
|
} from "@/seqta/utils/googleCalendar/types";
|
||||||
|
|
||||||
export type { CalendarSyncProvider as CalendarProvider };
|
export type CalendarProvider = CalendarSyncProvider;
|
||||||
|
|
||||||
const MSG = {
|
const MSG = {
|
||||||
accessToken: { google: "googleCalendarGetAccessToken", outlook: "outlookCalendarGetAccessToken" },
|
accessToken: { google: "googleCalendarGetAccessToken", outlook: "outlookCalendarGetAccessToken" },
|
||||||
|
|||||||
Reference in new issue
Block a user