From 6e1f485049a9539ad24c2c1ca8beabd9bddaa39d Mon Sep 17 00:00:00 2001 From: hustlernik Date: Wed, 15 Jan 2025 20:52:12 +0530 Subject: [PATCH] fix failing test --- .../EventCalendar/EventCalendar.tsx | 69 ++++++++++--------- src/screens/UserPortal/Events/Events.spec.tsx | 2 +- src/style/app.module.css | 7 ++ 3 files changed, 43 insertions(+), 35 deletions(-) diff --git a/src/components/EventCalendar/EventCalendar.tsx b/src/components/EventCalendar/EventCalendar.tsx index 89a92d12b9..01426ca047 100644 --- a/src/components/EventCalendar/EventCalendar.tsx +++ b/src/components/EventCalendar/EventCalendar.tsx @@ -198,11 +198,11 @@ const Calendar: React.FC = ({ } }; - // const handleTodayButton = (): void => { - // setCurrentYear(today.getFullYear()); - // setCurrentMonth(today.getMonth()); - // setCurrentDate(today.getDate()); - // }; + const handleTodayButton = (): void => { + setCurrentYear(today.getFullYear()); + setCurrentMonth(today.getMonth()); + setCurrentDate(today.getDate()); + }; const timezoneString = `UTC${ new Date().getTimezoneOffset() > 0 ? '-' : '+' @@ -513,44 +513,45 @@ const Calendar: React.FC = ({
{viewType != ViewType.YEAR && (
- +
+ -
- {viewType == ViewType.DAY ? `${currentDate}` : ``} {currentYear}{' '} -
{months[currentMonth]}
+
+ {viewType == ViewType.DAY ? `${currentDate}` : ``} {currentYear}{' '} +
{months[currentMonth]}
+
+
- - {/*
+
-
*/} +
)}
diff --git a/src/screens/UserPortal/Events/Events.spec.tsx b/src/screens/UserPortal/Events/Events.spec.tsx index 0e49402019..86d257a937 100644 --- a/src/screens/UserPortal/Events/Events.spec.tsx +++ b/src/screens/UserPortal/Events/Events.spec.tsx @@ -650,7 +650,7 @@ describe('Testing Events Screen [User Portal]', () => { const calenderView = 'Calendar View'; expect(screen.queryAllByText(calenderView)).not.toBeNull(); - expect(screen.getByText('Sun')).toBeInTheDocument(); + expect(screen.getByText('Sunday')).toBeInTheDocument(); }); it('Testing DatePicker and TimePicker', async () => { diff --git a/src/style/app.module.css b/src/style/app.module.css index 04b4481a35..fea01199a5 100644 --- a/src/style/app.module.css +++ b/src/style/app.module.css @@ -5426,9 +5426,16 @@ button[data-testid='createPostBtn'] { .calendar__header { display: flex; align-items: center; + justify-content: space-between; + margin-right: 50px; /* margin: 2rem 10px 0px 10px; */ } +.calender_month { + display: flex; + align-items: center; +} + .calendar__header_month { margin: 0.5rem; color: var(--grey-dark);