Co-authored-by: Camille Moussu <cmoussu@linagora.com>
This commit is contained in:
@@ -68,18 +68,18 @@ describe("eventApi", () => {
|
||||
});
|
||||
|
||||
it("putEvent logs when status is 201", async () => {
|
||||
const consoleLogSpy = jest.spyOn(console, "log").mockImplementation();
|
||||
const consoleInfoSpy = jest.spyOn(console, "info").mockImplementation();
|
||||
const mockResponse = { status: 201, url: "/dav/cals/test.ics" };
|
||||
(api as unknown as jest.Mock).mockReturnValue(mockResponse);
|
||||
|
||||
await putEvent(mockEvent);
|
||||
|
||||
expect(consoleLogSpy).toHaveBeenCalledWith(
|
||||
expect(consoleInfoSpy).toHaveBeenCalledWith(
|
||||
"Event created successfully:",
|
||||
"/dav/cals/test.ics"
|
||||
);
|
||||
|
||||
consoleLogSpy.mockRestore();
|
||||
consoleInfoSpy.mockRestore();
|
||||
});
|
||||
|
||||
test("moveEvent sends MOVE request with destination header", async () => {
|
||||
|
||||
@@ -27,7 +27,7 @@ describe("Event Preview Display", () => {
|
||||
beforeEach(() => {
|
||||
jest.clearAllMocks();
|
||||
sessionStorage.clear();
|
||||
(window as any).MAIL_SPA_URL = null;
|
||||
window.MAIL_SPA_URL = null;
|
||||
});
|
||||
|
||||
const preloadedState = {
|
||||
@@ -598,7 +598,7 @@ describe("Event Preview Display", () => {
|
||||
});
|
||||
});
|
||||
it("properly render message button when MAIL_SPA_URL is not null and event has attendees", () => {
|
||||
(window as any).MAIL_SPA_URL = "test";
|
||||
window.MAIL_SPA_URL = "test";
|
||||
renderWithProviders(
|
||||
<EventPreviewModal
|
||||
open={true}
|
||||
@@ -612,7 +612,7 @@ describe("Event Preview Display", () => {
|
||||
expect(screen.getByText("eventPreview.emailAttendees")).toBeInTheDocument();
|
||||
});
|
||||
it("doesnt render message button when MAIL_SPA_URL is not null and event has no attendees", () => {
|
||||
(window as any).MAIL_SPA_URL = "test";
|
||||
window.MAIL_SPA_URL = "test";
|
||||
renderWithProviders(
|
||||
<EventPreviewModal
|
||||
open={true}
|
||||
@@ -637,7 +637,7 @@ describe("Event Preview Display", () => {
|
||||
expect(screen.queryByTestId("EmailIcon")).not.toBeInTheDocument();
|
||||
});
|
||||
it("message button opens url with attendees as uri and title as subject", () => {
|
||||
(window as any).MAIL_SPA_URL = "test";
|
||||
window.MAIL_SPA_URL = "test";
|
||||
const mockOpen = jest.fn();
|
||||
window.open = mockOpen;
|
||||
|
||||
@@ -669,7 +669,7 @@ describe("Event Preview Display", () => {
|
||||
});
|
||||
|
||||
it("message button encodes special characters in event title correctly", () => {
|
||||
(window as any).MAIL_SPA_URL = "test";
|
||||
window.MAIL_SPA_URL = "test";
|
||||
const mockOpen = jest.fn();
|
||||
window.open = mockOpen;
|
||||
|
||||
@@ -952,7 +952,7 @@ describe("Event Preview Display", () => {
|
||||
|
||||
beforeEach(() => {
|
||||
jest.clearAllMocks();
|
||||
(window as any).MAIL_SPA_URL = null;
|
||||
window.MAIL_SPA_URL = null;
|
||||
});
|
||||
|
||||
const createStateWithAttendees = (attendees: any[]) => ({
|
||||
|
||||
Reference in New Issue
Block a user