mirror of
https://github.com/atom/atom.git
synced 2026-04-06 03:02:13 -04:00
Test onDidChangeActivePaneItem observation in title-bar-spec
This commit is contained in:
@@ -1,12 +1,19 @@
|
||||
TitleBar = require '../src/title-bar'
|
||||
|
||||
describe "TitleBar", ->
|
||||
it 'updates the title based on document.title', ->
|
||||
titleBar = new TitleBar(atom)
|
||||
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
|
||||
|
||||
document.title = 'new-title'
|
||||
titleBar.updateTitle()
|
||||
atom.workspace.getActivePane().activateItem({
|
||||
getTitle: -> 'Test Title'
|
||||
})
|
||||
|
||||
expect(titleBar.element.querySelector('.title').textContent).toBe 'new-title'
|
||||
expect(document.title).not.toBe(initialTitle)
|
||||
expect(titleBar.element.querySelector('.title').textContent).toBe document.title
|
||||
|
||||
Reference in New Issue
Block a user