mirror of
https://github.com/atom/atom.git
synced 2026-04-28 03:01:47 -04:00
Test that destroyed panes aren't included in PaneContainer::getPanes()
This commit is contained in:
@@ -255,7 +255,9 @@ describe "PaneContainer", ->
|
||||
it "invokes the given callback when panes are destroyed", ->
|
||||
container = new PaneContainer(params)
|
||||
events = []
|
||||
container.onDidDestroyPane (event) -> events.push(event)
|
||||
container.onDidDestroyPane (event) ->
|
||||
expect(event.pane in container.getPanes()).toBe false
|
||||
events.push(event)
|
||||
|
||||
pane1 = container.getActivePane()
|
||||
pane2 = pane1.splitRight()
|
||||
@@ -266,6 +268,21 @@ describe "PaneContainer", ->
|
||||
|
||||
expect(events).toEqual [{pane: pane2}, {pane: pane3}]
|
||||
|
||||
it "invokes the given callback when the container is destroyed", ->
|
||||
container = new PaneContainer(params)
|
||||
events = []
|
||||
container.onDidDestroyPane (event) ->
|
||||
expect(event.pane in container.getPanes()).toBe false
|
||||
events.push(event)
|
||||
|
||||
pane1 = container.getActivePane()
|
||||
pane2 = pane1.splitRight()
|
||||
pane3 = pane2.splitDown()
|
||||
|
||||
container.destroy()
|
||||
|
||||
expect(events).toEqual [{pane: pane1}, {pane: pane2}, {pane: pane3}]
|
||||
|
||||
describe "::onWillDestroyPaneItem() and ::onDidDestroyPaneItem", ->
|
||||
it "invokes the given callbacks when an item will be destroyed on any pane", ->
|
||||
container = new PaneContainer(params)
|
||||
|
||||
Reference in New Issue
Block a user