Skip to content

Commit

Permalink
more
Browse files Browse the repository at this point in the history
  • Loading branch information
araujoarthur0 committed Feb 7, 2025
1 parent f11c972 commit 0e2141d
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions __tests__/__main__/main-window.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ describe('main-window.mjs', () =>
{
it('It should send new event to ipcRenderer', function(done)
{
this.timeout(15000);
// this.timeout(15000);
assert.strictEqual(savePreferences({
...getDefaultPreferences(),
['view']: 'month'
Expand All @@ -180,14 +180,20 @@ describe('main-window.mjs', () =>
console.log('test4', Date.now());
// First within the month view sizes
// Width and height are within 5 pixels of the expected values
assert.strictEqual(Math.abs(windowSize[0] - 1010) < 5, true, `Value was ${windowSize[0]}`);
assert.strictEqual(Math.abs(windowSize[1] - 800) < 5, true, `Value was ${windowSize[1]}`);
setTimeout(function()
{
assert.strictEqual(Math.abs(windowSize[0] - 1010) < 5, true, `Value was ${windowSize[0]}`);
assert.strictEqual(Math.abs(windowSize[1] - 800) < 5, true, `Value was ${windowSize[1]}`);
});

const windowStub = stub(mainWindow.webContents, 'send').callsFake((event, savedPreferences) =>
{
assert.strictEqual(windowStub.calledOnce, true);
assert.strictEqual(savedPreferences['view'], 'day');
done();
setTimeout(function()
{
assert.strictEqual(windowStub.calledOnce, true);
assert.strictEqual(savedPreferences['view'], 'day');
done();
});
});
console.log('test5', Date.now());
ipcMain.emit(IpcConstants.SwitchView);
Expand Down

0 comments on commit 0e2141d

Please sign in to comment.