Wrap around fuzzy finder when at top or bottom

This commit is contained in:
Kevin Sawicki
2012-10-02 10:39:35 -07:00
parent f51c5dffed
commit 189e3be5ae
2 changed files with 19 additions and 16 deletions

View File

@@ -223,16 +223,15 @@ describe 'FuzzyFinder', ->
expect(finder.find('li:eq(1)')).toHaveClass "selected"
expect(finder.find('li:eq(2)')).not.toHaveClass "selected"
it "does not fall off the end or begining of the list", ->
it "wraps around when at the end or begining of the list", ->
expect(finder.find('li:first')).toHaveClass "selected"
finder.miniEditor.trigger keydownEvent('up')
expect(finder.find('li:first')).toHaveClass "selected"
for i in [1..finder.pathList.children().length+2]
finder.miniEditor.trigger keydownEvent('down')
expect(finder.find('li:last')).toHaveClass "selected"
finder.miniEditor.trigger keydownEvent('down')
expect(finder.find('li:first')).toHaveClass "selected"
describe "when the fuzzy finder loses focus", ->
it "detaches itself", ->
rootView.attachToDom()