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:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user