Attach to DOM in specs that alter the mini editor

This is now required since populateList() is only
calls when the timeout is fired and the select list
is still on the DOM.
This commit is contained in:
Kevin Sawicki
2013-04-02 13:22:42 -07:00
parent f3e1a72882
commit 3cfbbc5d94
2 changed files with 6 additions and 0 deletions

View File

@@ -124,6 +124,9 @@ describe "SelectList", ->
expect(selectList.confirmed).toHaveBeenCalledWith(array[2])
describe "when there is no item selected (because the list is empty)", ->
beforeEach ->
selectList.attachToDom()
it "does not trigger the confirmed hook", ->
miniEditor.insertText("i will never match anything")
window.advanceClock(selectList.inputThrottle)

View File

@@ -288,6 +288,9 @@ describe "AutocompleteView", ->
expect(editor.lineForBufferRow(10)).toBe matchToSelect.text()
describe "when the mini-editor receives keyboard input", ->
beforeEach ->
editor.attachToDom()
describe "when text is removed from the mini-editor", ->
it "reloads the match list based on the mini-editor's text", ->
editor.getBuffer().insert([10,0] ,"t")