calendar list display improvments (#115)

* [#60] added collapsible groups

* [#60] factorized code and fixed tests

* fixup! [#60] added collapsible groups

* fixup! [#60] added collapsible groups

---------

Co-authored-by: Camille Moussu <cmoussu@linagora.com>
This commit is contained in:
Camille Moussu
2025-09-18 18:01:08 +02:00
committed by GitHub
parent b8cef20b9e
commit 8a7d2f742a
3 changed files with 136 additions and 61 deletions
+22 -1
View File
@@ -123,7 +123,7 @@ describe("CalendarSelection", () => {
renderWithProviders(<CalendarApp />, preloadedState);
expect(screen.getByText("Personnal Calendars")).toBeInTheDocument();
expect(screen.getByText("Delegated Calendars")).toBeInTheDocument();
expect(screen.getByText("Shared Calendars")).toBeInTheDocument();
expect(screen.getByText("Other Calendars")).toBeInTheDocument();
expect(screen.getByLabelText("Calendar personnal")).toBeInTheDocument();
expect(screen.getByLabelText("Calendar delegated")).toBeInTheDocument();
@@ -147,4 +147,25 @@ describe("CalendarSelection", () => {
expect(spy).toHaveBeenCalled();
});
});
it("open accordeon when clicking on button only", () => {
renderWithProviders(<CalendarApp />, preloadedState);
expect(screen.getByText("Personnal Calendars")).toBeInTheDocument();
expect(screen.getByText("Delegated Calendars")).toBeInTheDocument();
expect(screen.getByText("Other Calendars")).toBeInTheDocument();
expect(screen.getByLabelText("Calendar personnal")).toBeInTheDocument();
expect(screen.getByLabelText("Calendar delegated")).toBeInTheDocument();
expect(screen.getByLabelText("Calendar shared")).toBeInTheDocument();
const delegatedAccordionSummary = screen
.getByText("Delegated Calendars")
.closest(".MuiAccordionSummary-root");
const addButton = screen.getAllByTestId("AddIcon")[1];
fireEvent.click(addButton);
expect(delegatedAccordionSummary).toHaveAttribute("aria-expanded", "true");
fireEvent.click(addButton);
expect(delegatedAccordionSummary).toHaveAttribute("aria-expanded", "true");
});
});
@@ -50,7 +50,7 @@ describe("CalendarSelection", () => {
expect(screen.getByText("Personnal Calendars")).toBeInTheDocument();
expect(screen.getByText("Delegated Calendars")).toBeInTheDocument();
expect(screen.getByText("Shared Calendars")).toBeInTheDocument();
expect(screen.getByText("Other Calendars")).toBeInTheDocument();
expect(screen.getByLabelText("Calendar personnal")).toBeChecked();
expect(screen.getByLabelText("Calendar delegated")).not.toBeChecked();
@@ -113,7 +113,7 @@ describe("CalendarSelection", () => {
}
);
const addButton = screen.getByTestId("AddIcon");
const addButton = screen.getAllByTestId("AddIcon")[0];
fireEvent.click(addButton);
expect(screen.getByRole("presentation")).toBeInTheDocument();