mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-11-10 10:17:11 +03:00
c029151322
Testing the wiring to themes isn't worth it, but this at least makes sure we don't break if Electron APIs change.
30 lines
954 B
CoffeeScript
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()
|