pulsar/spec/title-bar-spec.coffee
Nathan Sobo c029151322 Test that updateWindowSheetOffset can be called
Testing the wiring to themes isn't worth it, but this at least makes sure we don't break if Electron APIs change.
2016-08-02 16:16:27 -06:00

30 lines
954 B
CoffeeScript

TitleBar = require '../src/title-bar'
describe "TitleBar", ->
it "updates the title based on document.title when the active pane item changes", ->
titleBar = new TitleBar({
workspace: atom.workspace,
themes: atom.themes,
applicationDelegate: atom.applicationDelegate,
})
expect(titleBar.element.querySelector('.title').textContent).toBe document.title
initialTitle = document.title
atom.workspace.getActivePane().activateItem({
getTitle: -> 'Test Title'
})
expect(document.title).not.toBe(initialTitle)
expect(titleBar.element.querySelector('.title').textContent).toBe document.title
it "can update the sheet offset for the current window based on its height", ->
titleBar = new TitleBar({
workspace: atom.workspace,
themes: atom.themes,
applicationDelegate: atom.applicationDelegate,
})
expect(->
titleBar.updateWindowSheetOffset()
).not.toThrow()