Add spec for Pane::destroyInactiveItems to pane-spec

This commit is contained in:
Nathan Sobo
2014-01-14 19:32:39 -07:00
parent cf6fc22c87
commit e553fefc25
2 changed files with 8 additions and 7 deletions

View File

@@ -125,6 +125,14 @@ describe "Pane", ->
pane.items[1].destroy()
expect(pane.items).toEqual [item1, item3]
describe "::destroyInactiveItems()", ->
it "destroys all items but the active item", ->
pane = new Pane(items: [new Item("A"), new Item("B"), new Item("C")])
[item1, item2, item3] = pane.items
pane.activateItem(item2)
pane.destroyInactiveItems()
expect(pane.items).toEqual [item2]
describe "::moveItem(item, index)", ->
it "moves the item to the given index and emits an 'item-moved' event with the item and its new index", ->
pane = new Pane(items: [new Item("A"), new Item("B"), new Item("C"), new Item("D")])

View File

@@ -138,13 +138,6 @@ describe "PaneView", ->
paneModel2.activateItemAtIndex(1)
expect(view1.data('preservative')).toBe 1234
describe "pane:close-other-items", ->
it "destroys all items except the current", ->
pane.activateItem(editor1)
pane.trigger 'pane:close-other-items'
expect(editor2.isDestroyed()).toBe true
expect(pane.getItems()).toEqual [editor1]
describe "::saveActiveItem()", ->
describe "when the current item has a uri", ->
describe "when the current item has a save method", ->