[#101] prettified code + added test

This commit is contained in:
Camille Moussu
2025-09-26 10:09:51 +02:00
committed by Benoit TELLIER
parent ac9db2b520
commit b46be3af29
3 changed files with 127 additions and 22 deletions
@@ -209,4 +209,50 @@ describe("CalendarApp integration", () => {
);
expect(found).toBe(false);
});
it("does render a title for events without any attendees or user as organizer", async () => {
const mockCalendarRef = { current: null };
renderWithProviders(<CalendarApp calendarRef={mockCalendarRef} />, {
user: {
userData: {
sub: "test",
email: "test@test.com",
sid: "mockSid",
openpaasId: "667037022b752d0026472254",
},
tokens: {
accessToken: "token",
},
},
calendars: {
list: {
"667037022b752d0026472254/cal1": {
name: "Calendar 1",
id: "667037022b752d0026472254/cal1",
color: "#FF0000",
ownerEmails: ["alice@example.com"],
events: {
event1: {
id: "event1",
calId: "667037022b752d0026472254/cal1",
uid: "event1",
start: new Date().toISOString(),
end: new Date(Date.now() + 3600000).toISOString(),
partstat: "ACCEPTED",
organizer: {
cn: "Alice",
cal_address: "alice@example.com",
},
class: "PUBLIC",
title: "Public Event",
},
},
},
},
pending: false,
},
});
expect(screen.getByText("Public Event")).toBeInTheDocument();
});
});