Skip to content

Commit 22346de

Browse files
committed
fix: Failing test
1 parent fbbe86f commit 22346de

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

tests/unit/utils.spec.ts

+7-4
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,7 @@ const getMinMax = () => {
7373
return { minDate, maxDate };
7474
};
7575

76-
const getMapDatesOpts = (date: Date, timezone: TimeZoneConfig) => {
77-
const highlightFn = (date: any) => !!date;
76+
const getMapDatesOpts = (date: Date, timezone: TimeZoneConfig, highlightFn: (date: any) => boolean) => {
7877
return {
7978
minDate: date,
8079
maxDate: date,
@@ -448,7 +447,9 @@ describe('Utils and date utils formatting', () => {
448447
it('Should map propDates value with and without timezone', async () => {
449448
const today = resetDateTime(new Date());
450449
const highlightFn = (date: any) => !!date;
451-
const mappedDates = mapPropDates(getMapDatesOpts(today, { timezone: undefined, exactMatch: false }));
450+
const mappedDates = mapPropDates(
451+
getMapDatesOpts(today, { timezone: undefined, exactMatch: false }, highlightFn),
452+
);
452453

453454
expect(mappedDates.maxDate).toEqual(today);
454455
expect(mappedDates.minDate).toEqual(today);
@@ -457,7 +458,9 @@ describe('Utils and date utils formatting', () => {
457458
expect(mappedDates.highlight).toEqual(highlightFn);
458459

459460
const todayInTz = localToTz(today, 'UTC');
460-
const mappedDatesInTimezone = mapPropDates(getMapDatesOpts(today, { timezone: 'UTC', exactMatch: false }));
461+
const mappedDatesInTimezone = mapPropDates(
462+
getMapDatesOpts(today, { timezone: 'UTC', exactMatch: false }, highlightFn),
463+
);
461464

462465
expect(mappedDatesInTimezone.maxDate).toEqual(todayInTz);
463466
expect(mappedDatesInTimezone.minDate).toEqual(todayInTz);

0 commit comments

Comments
 (0)