Skip to content

Commit

Permalink
Mocking missing ipc handlers for flexible day calendar
Browse files Browse the repository at this point in the history
  • Loading branch information
araujoarthur0 committed Dec 29, 2023
1 parent a481fd3 commit a45334e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions __tests__/__renderer__/classes/FlexibleDayCalendar.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/* eslint-disable no-undef */

const Store = require('electron-store');
import { computeAllTimeBalanceUntilAsync } from '../../../js/time-balance.js';
import { defaultPreferences } from '../../../js/user-preferences.js';
import { CalendarFactory } from '../../../renderer/classes/CalendarFactory.js';
import { calendarApi } from '../../../renderer/preload-scripts/calendar-api.js';
Expand Down Expand Up @@ -50,6 +51,13 @@ window.mainApi.deleteFlexibleStoreData = (key) =>
resolve(true);
});
};
window.mainApi.computeAllTimeBalanceUntilPromise = (targetDate) =>
{
return new Promise((resolve) =>
{
resolve(computeAllTimeBalanceUntilAsync(targetDate));
});
};

describe('FlexibleDayCalendar class Tests', () =>
{
Expand Down

0 comments on commit a45334e

Please sign in to comment.