Guard against PaneAxis as first child

Pane::findLeftmostSibling expected to return a Pane, not a PaneAxis
This commit is contained in:
Kevin Sawicki
2014-05-05 09:09:25 -07:00
parent 1c514bdc6b
commit 8b5fd64dd4
2 changed files with 24 additions and 4 deletions

View File

@@ -127,6 +127,22 @@ describe "Workspace", ->
expect(pane1.items).toEqual [editor]
expect(pane2.items).toEqual []
describe "when a pane axis is to the left of the current pane", ->
it "opens the new item in the current pane", ->
editor = null
pane1 = workspace.activePane
pane2 = pane1.splitLeft()
pane3 = pane2.splitDown()
pane1.activate()
expect(workspace.activePane).toBe pane1
waitsForPromise ->
workspace.open('a', split: 'left').then (o) -> editor = o
runs ->
expect(workspace.activePane).toBe pane1
expect(pane1.items).toEqual [editor]
describe "when the 'split' option is 'right'", ->
it "opens the editor in the rightmost pane of the current pane axis", ->
editor = null