mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-09-20 23:48:05 +03:00
Add spec for destroyed pane items getting removed at the model layer
This commit is contained in:
parent
4dcba4bb27
commit
5ca7ad3bce
@ -1,3 +1,4 @@
|
||||
{Model} = require 'theorist'
|
||||
PaneModel = require '../src/pane-model'
|
||||
PaneAxisModel = require '../src/pane-axis-model'
|
||||
PaneContainerModel = require '../src/pane-container-model'
|
||||
@ -103,6 +104,14 @@ describe "PaneModel", ->
|
||||
pane.removeItemAtIndex(0)
|
||||
pane.removeItemAtIndex(0)
|
||||
expect(pane.isDestroyed()).toBe true
|
||||
|
||||
describe "when an item emits a destroyed event", ->
|
||||
it "removes it from the list of items", ->
|
||||
pane = new PaneModel(items: [new Model, new Model, new Model])
|
||||
[item1, item2, item3] = pane.items
|
||||
pane.items[1].destroy()
|
||||
expect(pane.items).toEqual [item1, item3]
|
||||
|
||||
describe "::destroy()", ->
|
||||
[pane1, container] = []
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user