[#67] added export calendar functionnality (#294)

Co-authored-by: Camille Moussu <cmoussu@linagora.com>
This commit is contained in:
Camille Moussu
2025-11-12 20:42:35 +01:00
committed by GitHub
parent f886846a2b
commit 6305f55d1a
5 changed files with 105 additions and 10 deletions
@@ -2,6 +2,7 @@
import {
addSharedCalendar,
exportCalendar,
getCalendar,
getCalendars,
getSecretLink,
@@ -149,6 +150,20 @@ describe("Calendar API", () => {
);
});
it("get export data ", async () => {
const calLink = "/calendars/calId.json";
(api.get as jest.Mock).mockReturnValue({
text: jest.fn().mockResolvedValue("data"),
});
const data = await exportCalendar(calLink);
expect(api.get).toHaveBeenCalledWith(`dav${calLink}?export`, {
headers: {
Accept: "application/calendar",
},
});
});
it("When adding a sharedCal with #default as a name a new name is sent to the back", async () => {
const mockApiPost = jest.spyOn(api, "post");