From 3cfbbc5d9400d8a4c5cde8226acb7dd095e17c72 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Tue, 2 Apr 2013 13:22:42 -0700 Subject: [PATCH] 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. --- spec/app/select-list-spec.coffee | 3 +++ src/packages/autocomplete/spec/autocomplete-spec.coffee | 3 +++ 2 files changed, 6 insertions(+) diff --git a/spec/app/select-list-spec.coffee b/spec/app/select-list-spec.coffee index a39c4a128..5702fe546 100644 --- a/spec/app/select-list-spec.coffee +++ b/spec/app/select-list-spec.coffee @@ -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) diff --git a/src/packages/autocomplete/spec/autocomplete-spec.coffee b/src/packages/autocomplete/spec/autocomplete-spec.coffee index b525a8fe7..0bc25a3f0 100644 --- a/src/packages/autocomplete/spec/autocomplete-spec.coffee +++ b/src/packages/autocomplete/spec/autocomplete-spec.coffee @@ -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")