fix test failures

This commit is contained in:
Corey Johnson & Nathan Sobo
2012-05-11 16:06:42 -07:00
parent d51b229d56
commit af65bd785c
3 changed files with 2 additions and 12 deletions

View File

@@ -238,11 +238,6 @@ describe "TreeView", ->
expect(treeView.find('.selected').length).toBeLessThan 2
describe "move-down", ->
describe "when nothing is selected", ->
it "selects the first entry", ->
treeView.trigger 'move-down'
expect(treeView.root).toHaveClass 'selected'
describe "when a collapsed directory is selected", ->
it "skips to the next directory", ->
treeView.root.find('.directory:eq(0)').click()
@@ -279,11 +274,6 @@ describe "TreeView", ->
expect(lastEntry).toHaveClass 'selected'
describe "move-up", ->
describe "when nothing is selected", ->
it "selects the last entry", ->
treeView.trigger 'move-up'
expect(treeView.root.find('.entry:last')).toHaveClass 'selected'
describe "when there is an expanded directory before the currently selected entry", ->
it "selects the last entry in the expanded directory", ->
lastDir = treeView.root.find('.directory:last').view()

View File

@@ -15,7 +15,7 @@ beforeEach ->
directoriesWithSubscriptions = []
afterEach ->
# $('#jasmine-content').empty()
$('#jasmine-content').empty()
document.title = defaultTitle
ensureNoDirectorySubscriptions()

View File

@@ -56,7 +56,7 @@ class TreeView extends View
@on 'tree-view:unfocus', => @rootView.activeEditor()?.focus()
@rootView.on 'tree-view:focus', => this.focus()
@selectEntry(@root)
@selectEntry(@root) if @root
afterAttach: (onDom) ->
@focus() if @focusAfterAttach