Co-authored-by: Camille Moussu <cmoussu@linagora.com>
This commit is contained in:
@@ -300,13 +300,13 @@ describe("Event Preview Display", () => {
|
||||
screen.getByText("eventPreview.attendingQuestion")
|
||||
).toBeInTheDocument();
|
||||
expect(
|
||||
screen.getByRole("button", { name: "eventPreview.accept" })
|
||||
screen.getByRole("button", { name: "eventPreview.ACCEPTED" })
|
||||
).toBeInTheDocument();
|
||||
expect(
|
||||
screen.getByRole("button", { name: "eventPreview.maybe" })
|
||||
screen.getByRole("button", { name: "eventPreview.TENTATIVE" })
|
||||
).toBeInTheDocument();
|
||||
expect(
|
||||
screen.getByRole("button", { name: "eventPreview.decline" })
|
||||
screen.getByRole("button", { name: "eventPreview.DECLINED" })
|
||||
).toBeInTheDocument();
|
||||
});
|
||||
it("doesnt renders RSVP buttons when user isnt an attendee", () => {
|
||||
@@ -354,13 +354,13 @@ describe("Event Preview Display", () => {
|
||||
screen.queryByText("eventPreview.attendingQuestion")
|
||||
).not.toBeInTheDocument();
|
||||
expect(
|
||||
screen.queryByRole("button", { name: "eventPreview.accept" })
|
||||
screen.queryByRole("button", { name: "eventPreview.ACCEPTED" })
|
||||
).not.toBeInTheDocument();
|
||||
expect(
|
||||
screen.queryByRole("button", { name: "eventPreview.maybe" })
|
||||
screen.queryByRole("button", { name: "eventPreview.TENTATIVE" })
|
||||
).not.toBeInTheDocument();
|
||||
expect(
|
||||
screen.queryByRole("button", { name: "eventPreview.decline" })
|
||||
screen.queryByRole("button", { name: "eventPreview.DECLINED" })
|
||||
).not.toBeInTheDocument();
|
||||
});
|
||||
|
||||
@@ -414,7 +414,7 @@ describe("Event Preview Display", () => {
|
||||
);
|
||||
|
||||
fireEvent.click(
|
||||
screen.getByRole("button", { name: "eventPreview.accept" })
|
||||
screen.getByRole("button", { name: "eventPreview.ACCEPTED" })
|
||||
);
|
||||
|
||||
await waitFor(() => {
|
||||
@@ -474,7 +474,9 @@ describe("Event Preview Display", () => {
|
||||
rsvpState
|
||||
);
|
||||
|
||||
fireEvent.click(screen.getByRole("button", { name: "eventPreview.maybe" }));
|
||||
fireEvent.click(
|
||||
screen.getByRole("button", { name: "eventPreview.TENTATIVE" })
|
||||
);
|
||||
|
||||
await waitFor(() => {
|
||||
expect(spy).toHaveBeenCalled();
|
||||
@@ -534,7 +536,7 @@ describe("Event Preview Display", () => {
|
||||
);
|
||||
|
||||
fireEvent.click(
|
||||
screen.getByRole("button", { name: "eventPreview.decline" })
|
||||
screen.getByRole("button", { name: "eventPreview.DECLINED" })
|
||||
);
|
||||
|
||||
await waitFor(() => {
|
||||
@@ -1020,7 +1022,7 @@ describe("Event Preview Display", () => {
|
||||
).not.toBeInTheDocument();
|
||||
});
|
||||
|
||||
it("displays only maybe count when all attendees tentative", () => {
|
||||
it("displays only TENTATIVE count when all attendees tentative", () => {
|
||||
const attendees = [
|
||||
{
|
||||
cn: "organizer",
|
||||
@@ -1262,7 +1264,7 @@ describe("Event Preview Display", () => {
|
||||
).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it("displays correct counts with multiple yes and maybe", () => {
|
||||
it("displays correct counts with multiple yes and TENTATIVE", () => {
|
||||
const attendees = [
|
||||
{
|
||||
cn: "Guest 1",
|
||||
|
||||
@@ -258,7 +258,7 @@ describe("EventPopover", () => {
|
||||
{
|
||||
cn: "John Doe",
|
||||
cal_address: "john@example.com",
|
||||
partstat: "NEED_ACTION",
|
||||
partstat: "NEEDS-ACTION",
|
||||
rsvp: "FALSE",
|
||||
role: "REQ-PARTICIPANT",
|
||||
cutype: "INDIVIDUAL",
|
||||
|
||||
@@ -315,7 +315,7 @@ describe("EventPreviewModal - Recurring Event Interactions", () => {
|
||||
);
|
||||
|
||||
fireEvent.click(
|
||||
screen.getByRole("button", { name: "eventPreview.accept" })
|
||||
screen.getByRole("button", { name: "eventPreview.ACCEPTED" })
|
||||
);
|
||||
|
||||
await waitFor(() => {
|
||||
@@ -505,7 +505,7 @@ describe("RSVP to Recurring Event", () => {
|
||||
);
|
||||
|
||||
fireEvent.click(
|
||||
screen.getByRole("button", { name: "eventPreview.accept" })
|
||||
screen.getByRole("button", { name: "eventPreview.ACCEPTED" })
|
||||
);
|
||||
|
||||
await waitFor(() => {
|
||||
@@ -543,7 +543,7 @@ describe("RSVP to Recurring Event", () => {
|
||||
);
|
||||
|
||||
fireEvent.click(
|
||||
screen.getByRole("button", { name: "eventPreview.accept" })
|
||||
screen.getByRole("button", { name: "eventPreview.ACCEPTED" })
|
||||
);
|
||||
|
||||
await waitFor(() => {
|
||||
@@ -975,8 +975,7 @@ describe("handleRSVP function", () => {
|
||||
basePreloadedState.calendars.list["667037022b752d0026472254/cal1"],
|
||||
basePreloadedState.user,
|
||||
nonRecurringEvent,
|
||||
"ACCEPTED",
|
||||
mockOnClose
|
||||
"ACCEPTED"
|
||||
);
|
||||
|
||||
expect(mockDispatch).toHaveBeenCalled();
|
||||
|
||||
@@ -13,7 +13,7 @@ import EventUpdateModal from "../../../src/features/Events/EventUpdateModal";
|
||||
import CalendarLayout from "../../../src/components/Calendar/CalendarLayout";
|
||||
import { renderWithProviders } from "../../utils/Renderwithproviders";
|
||||
import { SpiedFunction } from "jest-mock";
|
||||
import { Calendars } from "../../../src/features/Calendars/CalendarTypes";
|
||||
import { Calendar } from "../../../src/features/Calendars/CalendarTypes";
|
||||
import { CalendarEvent } from "../../../src/features/Events/EventsTypes";
|
||||
import { DateSelectArg } from "@fullcalendar/core";
|
||||
|
||||
@@ -27,7 +27,7 @@ describe("Update tempcalendars called with correct params", () => {
|
||||
let refreshCalendarsSpy: SpiedFunction<
|
||||
(
|
||||
dispatch: ThunkDispatch<any, any, any>,
|
||||
calendars: Calendars[],
|
||||
calendars: Calendar[],
|
||||
calendarRange: { start: Date; end: Date },
|
||||
calType?: "temp"
|
||||
) => Promise<void>
|
||||
@@ -35,14 +35,14 @@ describe("Update tempcalendars called with correct params", () => {
|
||||
let refreshSingularCalendarSpy: SpiedFunction<
|
||||
(
|
||||
dispatch: ThunkDispatch<any, any, any>,
|
||||
calendar: Calendars,
|
||||
calendar: Calendar,
|
||||
calendarRange: { start: Date; end: Date },
|
||||
calType?: "temp"
|
||||
) => Promise<void>
|
||||
>;
|
||||
let updateTempCalendarSpy: SpiedFunction<
|
||||
(
|
||||
tempcalendars: Record<string, Calendars>,
|
||||
tempcalendars: Record<string, Calendar>,
|
||||
event: CalendarEvent,
|
||||
dispatch: ThunkDispatch<any, any, any>,
|
||||
calendarRange: { start: Date; end: Date }
|
||||
|
||||
@@ -71,9 +71,9 @@ describe("parseCalendarEvent", () => {
|
||||
cn: "Bob",
|
||||
cal_address: "bob@example.com",
|
||||
partstat: "ACCEPTED",
|
||||
rsvp: "",
|
||||
role: "",
|
||||
cutype: "",
|
||||
cutype: "INDIVIDUAL",
|
||||
role: "REQ-PARTICIPANT",
|
||||
rsvp: "FALSE",
|
||||
},
|
||||
]);
|
||||
});
|
||||
@@ -133,9 +133,9 @@ describe("parseCalendarEvent", () => {
|
||||
cn: "Bob",
|
||||
cal_address: "bob@example.com",
|
||||
partstat: "ACCEPTED",
|
||||
rsvp: "",
|
||||
role: "",
|
||||
cutype: "",
|
||||
cutype: "INDIVIDUAL",
|
||||
role: "REQ-PARTICIPANT",
|
||||
rsvp: "FALSE",
|
||||
},
|
||||
]);
|
||||
});
|
||||
@@ -285,10 +285,10 @@ describe("parseCalendarEvent", () => {
|
||||
{
|
||||
cn: "",
|
||||
cal_address: "john@example.com",
|
||||
partstat: "",
|
||||
rsvp: "",
|
||||
role: "",
|
||||
cutype: "",
|
||||
partstat: "NEEDS-ACTION",
|
||||
cutype: "INDIVIDUAL",
|
||||
role: "REQ-PARTICIPANT",
|
||||
rsvp: "FALSE",
|
||||
},
|
||||
]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user