Skip to content

Commit

Permalink
Fixing calendar tests that require on current day
Browse files Browse the repository at this point in the history
  • Loading branch information
araujoarthur0 committed Oct 7, 2023
1 parent 697ed37 commit 4faa224
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions __tests__/__renderer__/classes/BaseCalendar.js
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,8 @@ describe('BaseCalendar.js', () =>

describe('punchDate()', () =>
{
const workAllDayPreferences = ({...getUserPreferences(), 'working-days-saturday': true,
'working-days-sunday': true});
const today = new Date();
const nextYear = new Date();
nextYear.setFullYear(today.getFullYear() + 1);
Expand Down Expand Up @@ -322,7 +324,8 @@ describe('BaseCalendar.js', () =>
date: new Date(),
getCalendar: () =>
{
const calendar = new ExtendedClass(getUserPreferences(), languageData);
// Setting all days as work days so test works every day
const calendar = new ExtendedClass(workAllDayPreferences, languageData);
return calendar;
},
expect: () =>
Expand Down Expand Up @@ -352,7 +355,8 @@ describe('BaseCalendar.js', () =>
date: new Date(),
getCalendar: () =>
{
const calendar = new ExtendedClass(getUserPreferences(), languageData);
// Setting all days as work days so test works every day
const calendar = new ExtendedClass(workAllDayPreferences, languageData);
return calendar;
},
expect: () =>
Expand Down

0 comments on commit 4faa224

Please sign in to comment.