Skip to content

Commit

Permalink
improved code cov
Browse files Browse the repository at this point in the history
  • Loading branch information
gurramkarthiknetha committed Dec 20, 2024
1 parent 5fd9926 commit fe51e0c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/components/EventCalendar/EventCalendar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,10 @@ const Calendar: React.FC<InterfaceCalendarProps> = ({
return Array.isArray(holidays)
? holidays.filter((holiday) => {
if (!holiday.date) {
console.warn(`Holiday "${holiday.name}" has no date specified.`);
return false;
console.warn(

Check warning on line 142 in src/components/EventCalendar/EventCalendar.tsx

View check run for this annotation

Codecov / codecov/patch

src/components/EventCalendar/EventCalendar.tsx#L142

Added line #L142 was not covered by tests
`Holiday "${holiday.name}" has no date specified. Assigning a default date.`,
);
holiday.date = new Date().toISOString();

Check warning on line 145 in src/components/EventCalendar/EventCalendar.tsx

View check run for this annotation

Codecov / codecov/patch

src/components/EventCalendar/EventCalendar.tsx#L145

Added line #L145 was not covered by tests
}
const holidayMonth = dayjs(holiday.date, 'MM-DD', true).month();
return holidayMonth === currentMonth;
Expand Down

0 comments on commit fe51e0c

Please sign in to comment.