mirror of
https://github.com/atom/atom.git
synced 2026-01-23 13:58:08 -05:00
add a test
This commit is contained in:
19
spec/title-bar-element-spec.coffee
Normal file
19
spec/title-bar-element-spec.coffee
Normal file
@@ -0,0 +1,19 @@
|
||||
TitleBar = require '../src/title-bar'
|
||||
TitleBarElement = require '../src/title-bar-element'
|
||||
|
||||
describe "TitleBarElement", ->
|
||||
beforeEach ->
|
||||
atom.views.addViewProvider TitleBar, (model, env) ->
|
||||
new TitleBarElement().initialize(model, env)
|
||||
|
||||
it 'updates the title based on document.title', ->
|
||||
titleBar = new TitleBar({item: new TitleBarElement})
|
||||
element = atom.views.getView(titleBar)
|
||||
|
||||
expect(element.querySelector('.title').textContent).toBe document.title
|
||||
|
||||
document.title = 'new-title'
|
||||
element.updateTitle()
|
||||
|
||||
console.log element.querySelector('.title').textContent
|
||||
expect(element.querySelector('.title').textContent).toBe 'new-title'
|
||||
Reference in New Issue
Block a user