Add classes to the workspace for themes

Fixes #3097
This commit is contained in:
Ben Ogle
2014-08-21 11:53:10 -07:00
parent 30aa47026d
commit 26d696a93d
2 changed files with 27 additions and 0 deletions

View File

@@ -247,6 +247,21 @@ describe "ThemeManager", ->
# from within the theme itself
expect($(".editor").css("background-color")).toBe "rgb(0, 152, 255)"
describe "theme classes on the workspace", ->
it 'adds theme-* classes to the workspace for each active theme', ->
expect(atom.workspaceView).toHaveClass 'theme-atom-dark-ui'
themeManager.on 'reloaded', reloadHandler = jasmine.createSpy()
atom.config.set('core.themes', ['theme-with-ui-variables'])
waitsFor ->
reloadHandler.callCount > 0
runs ->
# `theme-` twice as it prefixes the name with `theme-`
expect(atom.workspaceView).toHaveClass 'theme-theme-with-ui-variables'
expect(atom.workspaceView).not.toHaveClass 'theme-atom-dark-ui'
describe "when the user stylesheet changes", ->
it "reloads it", ->
[stylesheetRemovedHandler, stylesheetAddedHandler, stylesheetsChangedHandler] = []