Co-authored-by: Camille Moussu <cmoussu@linagora.com>
This commit is contained in:
@@ -341,4 +341,11 @@ describe("EventPopover", () => {
|
|||||||
|
|
||||||
expect(mockOnClose).toHaveBeenCalledWith({}, "backdropClick");
|
expect(mockOnClose).toHaveBeenCalledWith({}, "backdropClick");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it("BUGFIX: Prefill Calendar field", async () => {
|
||||||
|
renderPopover();
|
||||||
|
await waitFor(() =>
|
||||||
|
expect(screen.getByLabelText("Calendar")).toHaveTextContent("Calendar 1")
|
||||||
|
);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -130,6 +130,12 @@ function EventPopover({
|
|||||||
userPersonnalCalendarsRef.current = userPersonnalCalendars;
|
userPersonnalCalendarsRef.current = userPersonnalCalendars;
|
||||||
}, [userPersonnalCalendars]);
|
}, [userPersonnalCalendars]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (!calendarid && userPersonnalCalendars.length > 0) {
|
||||||
|
setCalendarid(userPersonnalCalendars[0].id);
|
||||||
|
}
|
||||||
|
}, [calendarid, userPersonnalCalendars]);
|
||||||
|
|
||||||
const resetAllStateToDefault = useCallback(() => {
|
const resetAllStateToDefault = useCallback(() => {
|
||||||
setShowMore(false);
|
setShowMore(false);
|
||||||
setShowDescription(false);
|
setShowDescription(false);
|
||||||
|
|||||||
Reference in New Issue
Block a user