mirror of
https://github.com/atom/atom.git
synced 2026-04-06 03:02:13 -04:00
isEnabled -> platformSupportsUpdates
This commit is contained in:
@@ -64,7 +64,7 @@ describe('AutoUpdateManager (renderer)', () => {
|
||||
})
|
||||
})
|
||||
|
||||
describe('::isEnabled', () => {
|
||||
describe('::platformSupportsUpdates', () => {
|
||||
let platform, releaseChannel
|
||||
it('returns true on OS X and Windows, when in stable', () => {
|
||||
spyOn(autoUpdateManager, 'getPlatform').andCallFake(() => platform)
|
||||
@@ -72,27 +72,27 @@ describe('AutoUpdateManager (renderer)', () => {
|
||||
|
||||
platform = 'win32'
|
||||
releaseChannel = 'stable'
|
||||
expect(autoUpdateManager.isEnabled()).toBe(true)
|
||||
expect(autoUpdateManager.platformSupportsUpdates()).toBe(true)
|
||||
|
||||
platform = 'win32'
|
||||
releaseChannel = 'dev'
|
||||
expect(autoUpdateManager.isEnabled()).toBe(false)
|
||||
expect(autoUpdateManager.platformSupportsUpdates()).toBe(false)
|
||||
|
||||
platform = 'darwin'
|
||||
releaseChannel = 'stable'
|
||||
expect(autoUpdateManager.isEnabled()).toBe(true)
|
||||
expect(autoUpdateManager.platformSupportsUpdates()).toBe(true)
|
||||
|
||||
platform = 'darwin'
|
||||
releaseChannel = 'dev'
|
||||
expect(autoUpdateManager.isEnabled()).toBe(false)
|
||||
expect(autoUpdateManager.platformSupportsUpdates()).toBe(false)
|
||||
|
||||
platform = 'linux'
|
||||
releaseChannel = 'stable'
|
||||
expect(autoUpdateManager.isEnabled()).toBe(false)
|
||||
expect(autoUpdateManager.platformSupportsUpdates()).toBe(false)
|
||||
|
||||
platform = 'linux'
|
||||
releaseChannel = 'dev'
|
||||
expect(autoUpdateManager.isEnabled()).toBe(false)
|
||||
expect(autoUpdateManager.platformSupportsUpdates()).toBe(false)
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ export default class AutoUpdateManager {
|
||||
ipcRenderer.send('install-update')
|
||||
}
|
||||
|
||||
isEnabled () {
|
||||
platformSupportsUpdates () {
|
||||
return this.getReleaseChannel() == 'stable' && (this.getPlatform() === 'darwin' || this.getPlatform() === 'win32')
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user