Meta-/ (tree-view:toggle) attaches / detaches the TreeView

This commit is contained in:
Nathan Sobo
2012-05-08 15:35:03 -06:00
parent 79315b0ef6
commit 897f505e4f
3 changed files with 27 additions and 1 deletions

View File

@@ -96,6 +96,19 @@ describe "TreeView", ->
newTreeView = newRootView.find(".tree-view").view()
expect(newTreeView).toMatchSelector ':focus'
describe "when tree-view:toggle is triggered on the root view", ->
it "shows/hides the tree view", ->
rootView.attachToDom()
treeView.focus()
expect(treeView.hasParent()).toBeTruthy()
rootView.trigger 'tree-view:toggle'
expect(treeView.hasParent()).toBeFalsy()
expect(rootView).toMatchSelector(':focus')
rootView.trigger 'tree-view:toggle'
expect(treeView.hasParent()).toBeTruthy()
expect(treeView).toMatchSelector(':focus')
describe "when a directory's disclosure arrow is clicked", ->
it "expands / collapses the associated directory", ->
subdir = treeView.root.find('.entries > li:contains(dir/)').view()