Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reinstate auto updater tests - Closes #3519 #4007

Merged
merged 2 commits into from
Dec 14, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions app/src/modules/autoUpdater.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ export default ({ // eslint-disable-line max-statements
autoUpdater.autoDownload = false;

autoUpdater.checkForUpdatesAndNotify();
setInterval(() => {
autoUpdater.checkForUpdatesAndNotify();
}, 24 * 60 * 60 * 1000);

autoUpdater.on('error', (error) => {
// eslint-disable-next-line no-console
Expand Down
15 changes: 9 additions & 6 deletions app/src/modules/autoUpdater.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ describe('autoUpdater', () => {
expect(params.autoUpdater.checkForUpdatesAndNotify).to.have.been.calledWithExactly();
});

it.skip('should check for updates every 24 hours', () => {
it('should check for updates every 24 hours', () => {
autoUpdater(params);
expect(params.autoUpdater.checkForUpdatesAndNotify).to.have.callCount(1);
clock.tick(24 * 60 * 60 * 1000);
Expand Down Expand Up @@ -167,14 +167,17 @@ describe('autoUpdater', () => {
expect(params.win.send).to.have.been.calledWith({ event: 'downloadUpdateStart' });
});

/* it('should not download the update if update is available and the "Later" button was pressed',
() => {
autoUpdater(params);
it('should send update:available event when update is available', () => {
const newPrams = { ...params, electron };
autoUpdater(newPrams);
callbacks['update-available']({ version });
callbacks.dialog(1);
expect(params.win.send).to.have.been.calledWith({
event: 'update:available',
value: { releaseNotes: undefined, version },
});

expect(params.autoUpdater.downloadUpdate).to.not.have.been.calledWith();
}); */
});

it('should set the progress bar when being in download progress', () => {
autoUpdater(params);
Expand Down