-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a few more things before stepping aside to work on another issue
…maybe rebase this away…
- Loading branch information
Showing
4 changed files
with
54 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
'use babel' | ||
|
||
import Update from '../src/update' | ||
import remote from 'remote' | ||
|
||
fdescribe('Update', () => { | ||
describe('::initialize', () => { | ||
it('subscribes to appropriate applicationDelegate events', () => { | ||
const update = new Update() | ||
update.initialize() | ||
|
||
const downloadingSpy = jasmine.createSpy('downloadingSpy') | ||
const checkingSpy = jasmine.createSpy('checkingSpy') | ||
const noUpdateSpy = jasmine.createSpy('noUpdateSpy') | ||
|
||
update.onDidBeginCheckingForUpdate(checkingSpy) | ||
update.onDidBeginDownload(downloadingSpy) | ||
update.onUpdateNotAvailable(noUpdateSpy) | ||
|
||
const webContents = remote.getCurrentWebContents() | ||
// AutoUpdateManager sends these from main process land | ||
webContents.send('update-available', {releaseVersion: '1.2.3'}) | ||
webContents.send('did-begin-downloading-update') | ||
webContents.send('checking-for-update') | ||
webContents.send('update-not-available') | ||
|
||
waitsFor(() => { | ||
noUpdateSpy.callCount > 0 | ||
}) | ||
runs(() => { | ||
expect(downloadingSpy.callCount).toBe(1) | ||
expect(checkingSpy.callCount).toBe(1) | ||
expect(noUpdateSpy.callCount).toBe(1) | ||
}) | ||
}) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters