mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-11-11 04:48:44 +03:00
Fix another two tests
This commit is contained in:
parent
af66c5efaa
commit
468f4a47a9
@ -1375,7 +1375,8 @@ describe "PackageManager", ->
|
|||||||
atom.themes.activateThemes()
|
atom.themes.activateThemes()
|
||||||
|
|
||||||
afterEach ->
|
afterEach ->
|
||||||
atom.themes.deactivateThemes()
|
waitsForPromise ->
|
||||||
|
atom.themes.deactivateThemes()
|
||||||
|
|
||||||
it "enables and disables a theme", ->
|
it "enables and disables a theme", ->
|
||||||
packageName = 'theme-with-package-file'
|
packageName = 'theme-with-package-file'
|
||||||
|
@ -262,27 +262,25 @@ class ThemeManager
|
|||||||
new Promise (resolve) =>
|
new Promise (resolve) =>
|
||||||
# @config.observe runs the callback once, then on subsequent changes.
|
# @config.observe runs the callback once, then on subsequent changes.
|
||||||
@config.observe 'core.themes', =>
|
@config.observe 'core.themes', =>
|
||||||
@deactivateThemes()
|
@deactivateThemes().then =>
|
||||||
|
@warnForNonExistentThemes()
|
||||||
|
@refreshLessCache() # Update cache for packages in core.themes config
|
||||||
|
|
||||||
@warnForNonExistentThemes()
|
promises = []
|
||||||
|
for themeName in @getEnabledThemeNames()
|
||||||
|
if @packageManager.resolvePackagePath(themeName)
|
||||||
|
promises.push(@packageManager.activatePackage(themeName))
|
||||||
|
else
|
||||||
|
console.warn("Failed to activate theme '#{themeName}' because it isn't installed.")
|
||||||
|
|
||||||
@refreshLessCache() # Update cache for packages in core.themes config
|
Promise.all(promises).then =>
|
||||||
|
@addActiveThemeClasses()
|
||||||
promises = []
|
@refreshLessCache() # Update cache again now that @getActiveThemes() is populated
|
||||||
for themeName in @getEnabledThemeNames()
|
@loadUserStylesheet()
|
||||||
if @packageManager.resolvePackagePath(themeName)
|
@reloadBaseStylesheets()
|
||||||
promises.push(@packageManager.activatePackage(themeName))
|
@initialLoadComplete = true
|
||||||
else
|
@emitter.emit 'did-change-active-themes'
|
||||||
console.warn("Failed to activate theme '#{themeName}' because it isn't installed.")
|
resolve()
|
||||||
|
|
||||||
Promise.all(promises).then =>
|
|
||||||
@addActiveThemeClasses()
|
|
||||||
@refreshLessCache() # Update cache again now that @getActiveThemes() is populated
|
|
||||||
@loadUserStylesheet()
|
|
||||||
@reloadBaseStylesheets()
|
|
||||||
@initialLoadComplete = true
|
|
||||||
@emitter.emit 'did-change-active-themes'
|
|
||||||
resolve()
|
|
||||||
|
|
||||||
deactivateThemes: ->
|
deactivateThemes: ->
|
||||||
@removeActiveThemeClasses()
|
@removeActiveThemeClasses()
|
||||||
|
Loading…
Reference in New Issue
Block a user