405 back reload token with synctokens (#436)

* [#405] added syncToken in calendar params and fetch with sync token

* [#405] changed reload to work with sync-token

* [#405] fixup promise handling, added calendar adding and removing hanlding with refresh

* [#405]  fixed event expansion calls

* [#405 & refactor] added helperfunction to get base event uid + refactored synctoken updates management

* [#405] added pMap lib to process event expansion

* [#405] added flag for no synctoken / new synctoken
This commit is contained in:
Camille Moussu
2026-01-13 11:06:34 +01:00
committed by GitHub
parent bcc3019e4b
commit 478a0e0eb0
36 changed files with 1323 additions and 281 deletions
+6 -5
View File
@@ -3,7 +3,8 @@ import CalendarApp from "../../src/components/Calendar/Calendar";
import * as eventThunks from "../../src/features/Calendars/CalendarSlice";
import { renderWithProviders } from "../utils/Renderwithproviders";
import { searchUsers } from "../../src/features/User/userAPI";
import * as calendarThunks from "../../src/features/Calendars/CalendarSlice";
import * as calendarDetailThunks from "../../src/features/Calendars/services/getCalendarDetailAsync";
import { useRef } from "react";
import userEvent from "@testing-library/user-event";
@@ -552,7 +553,7 @@ describe("calendar Availability search", () => {
it("should fetch calendar details with date range matching the displayed month", async () => {
const spy = jest
.spyOn(calendarThunks, "getCalendarDetailAsync")
.spyOn(calendarDetailThunks, "getCalendarDetailAsync")
.mockImplementation((payload) => {
return () => Promise.resolve(payload) as any;
});
@@ -620,7 +621,7 @@ describe("calendar Availability search", () => {
};
const spy = jest
.spyOn(calendarThunks, "getCalendarDetailAsync")
.spyOn(calendarDetailThunks, "getCalendarDetailAsync")
.mockImplementation(() => ({
type: "getCalendarDetailAsync",
unwrap: () => Promise.resolve({}),
@@ -674,7 +675,7 @@ describe("calendar Availability search", () => {
};
const spy = jest
.spyOn(calendarThunks, "getCalendarDetailAsync")
.spyOn(calendarDetailThunks, "getCalendarDetailAsync")
.mockImplementation(() => ({
type: "getCalendarDetailAsync",
unwrap: () => Promise.resolve({}),
@@ -707,7 +708,7 @@ describe("calendar Availability search", () => {
it("does not make duplicate API calls for same calendar and range", async () => {
const spy = jest
.spyOn(calendarThunks, "getCalendarDetailAsync")
.spyOn(calendarDetailThunks, "getCalendarDetailAsync")
.mockImplementation(() => ({
type: "getCalendarDetailAsync",
unwrap: () => Promise.resolve({}),