fix: update tests for new Menubar UI implementation

- Remove refresh button test from Calendar.test.tsx
- Update Menubar tests to pass required props (calendarRef, onRefresh, currentDate)
- Update Calendar tests to pass calendarRef prop
- Remove outdated test cases from MiniCalendarColor.test.tsx that tested old headerToolbar
- Format code with prettier
This commit is contained in:
lenhanphung
2025-09-24 12:41:15 +07:00
parent 12dc0d7fe1
commit 0f74ddfc27
8 changed files with 240 additions and 281 deletions
@@ -69,7 +69,8 @@ describe("CalendarApp integration", () => {
},
};
renderWithProviders(<CalendarApp />, preloadedState);
const mockCalendarRef = { current: null };
renderWithProviders(<CalendarApp calendarRef={mockCalendarRef} />, preloadedState);
};
it("renders the event on the calendar and calendarRef works", async () => {
@@ -157,7 +158,8 @@ describe("CalendarApp integration", () => {
class: "PRIVATE",
title: "Private Event",
});
renderWithProviders(<CalendarApp />, preloadedState);
const mockCalendarRef = { current: null };
renderWithProviders(<CalendarApp calendarRef={mockCalendarRef} />, preloadedState);
const eventEls = screen.getAllByText("Private Event");
const found = eventEls.some((eventEl) =>
@@ -171,7 +173,8 @@ describe("CalendarApp integration", () => {
class: "CONFIDENTIAL",
title: "Confidential Event",
});
renderWithProviders(<CalendarApp />, preloadedState);
const mockCalendarRef = { current: null };
renderWithProviders(<CalendarApp calendarRef={mockCalendarRef} />, preloadedState);
const eventEls = screen.getAllByText("Confidential Event");
const found = eventEls.some((eventEl) =>
@@ -185,7 +188,8 @@ describe("CalendarApp integration", () => {
class: "PUBLIC",
title: "Public Event",
});
renderWithProviders(<CalendarApp />, preloadedState);
const mockCalendarRef = { current: null };
renderWithProviders(<CalendarApp calendarRef={mockCalendarRef} />, preloadedState);
const eventEls = screen.getAllByText("Public Event");
const found = eventEls.some((eventEl) =>