mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-11-10 10:17:11 +03:00
Use getActiveItem getter in pane-view-spec
This commit is contained in:
parent
b9feed8eb4
commit
1d365db9df
@ -37,7 +37,7 @@ describe "PaneView", ->
|
|||||||
|
|
||||||
describe "when the active pane item changes", ->
|
describe "when the active pane item changes", ->
|
||||||
it "hides all item views except the active one", ->
|
it "hides all item views except the active one", ->
|
||||||
expect(pane.activeItem).toBe view1
|
expect(pane.getActiveItem()).toBe view1
|
||||||
expect(view1.css('display')).not.toBe 'none'
|
expect(view1.css('display')).not.toBe 'none'
|
||||||
|
|
||||||
pane.activateItem(view2)
|
pane.activateItem(view2)
|
||||||
@ -48,7 +48,7 @@ describe "PaneView", ->
|
|||||||
itemChangedHandler = jasmine.createSpy("itemChangedHandler")
|
itemChangedHandler = jasmine.createSpy("itemChangedHandler")
|
||||||
container.on 'pane:active-item-changed', itemChangedHandler
|
container.on 'pane:active-item-changed', itemChangedHandler
|
||||||
|
|
||||||
expect(pane.activeItem).toBe view1
|
expect(pane.getActiveItem()).toBe view1
|
||||||
paneModel.activateItem(view2)
|
paneModel.activateItem(view2)
|
||||||
paneModel.activateItem(view2)
|
paneModel.activateItem(view2)
|
||||||
|
|
||||||
@ -149,7 +149,7 @@ describe "PaneView", ->
|
|||||||
activeItemTitleChangedHandler = jasmine.createSpy("activeItemTitleChangedHandler")
|
activeItemTitleChangedHandler = jasmine.createSpy("activeItemTitleChangedHandler")
|
||||||
pane.on 'pane:active-item-title-changed', activeItemTitleChangedHandler
|
pane.on 'pane:active-item-title-changed', activeItemTitleChangedHandler
|
||||||
|
|
||||||
expect(pane.activeItem).toBe view1
|
expect(pane.getActiveItem()).toBe view1
|
||||||
|
|
||||||
view2.trigger 'title-changed'
|
view2.trigger 'title-changed'
|
||||||
expect(activeItemTitleChangedHandler).not.toHaveBeenCalled()
|
expect(activeItemTitleChangedHandler).not.toHaveBeenCalled()
|
||||||
@ -246,7 +246,7 @@ describe "PaneView", ->
|
|||||||
|
|
||||||
it "transfers focus to the active view", ->
|
it "transfers focus to the active view", ->
|
||||||
focusHandler = jasmine.createSpy("focusHandler")
|
focusHandler = jasmine.createSpy("focusHandler")
|
||||||
pane.activeItem.on 'focus', focusHandler
|
pane.getActiveItem().on 'focus', focusHandler
|
||||||
pane.focus()
|
pane.focus()
|
||||||
expect(focusHandler).toHaveBeenCalled()
|
expect(focusHandler).toHaveBeenCalled()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user