Pass the version info through the event

This commit is contained in:
Ben Ogle 2016-02-23 17:34:31 -08:00
parent 3a5c827162
commit c9293e7733
2 changed files with 7 additions and 4 deletions

View File

@ -42,10 +42,13 @@ fdescribe('AutoUpdateManager (renderer)', () => {
it('subscribes to "did-complete-downloading-update" event', () => {
const spy = jasmine.createSpy('spy')
autoUpdateManager.onDidCompleteDownload(spy)
electronAutoUpdater.emit('update-downloaded', null, null, {releaseVersion: '1.2.3'})
electronAutoUpdater.emit('update-downloaded', null, null, '1.2.3')
waitsFor(() => {
return spy.callCount === 1
})
runs(() => {
expect(spy.mostRecentCall.args[0].releaseVersion).toBe('1.2.3')
})
})
})
@ -72,7 +75,7 @@ fdescribe('AutoUpdateManager (renderer)', () => {
autoUpdateManager.onUpdateNotAvailable(spy)
electronAutoUpdater.emit('checking-for-update')
electronAutoUpdater.emit('update-available')
electronAutoUpdater.emit('update-downloaded', null, null, {releaseVersion: '1.2.3'})
electronAutoUpdater.emit('update-downloaded', null, null, '1.2.3')
electronAutoUpdater.emit('update-not-available')
waitsFor(() => {

View File

@ -17,8 +17,8 @@ export default class AutoUpdateManager {
updateEventEmitter.onDidBeginCheckingForUpdate(() => {
this.emitter.emit('did-begin-checking-for-update')
}),
updateEventEmitter.onDidCompleteDownloadingUpdate(() => {
this.emitter.emit('did-complete-downloading-update')
updateEventEmitter.onDidCompleteDownloadingUpdate((details) => {
this.emitter.emit('did-complete-downloading-update', details)
}),
updateEventEmitter.onUpdateNotAvailable(() => {
this.emitter.emit('update-not-available')