From de3b48b2d3d8a1e31f76fe748e52d396ce4949db Mon Sep 17 00:00:00 2001 From: Antonio Scandurra Date: Fri, 8 Jul 2016 10:07:37 +0200 Subject: [PATCH] Use editor.update in tests --- spec/text-editor-element-spec.coffee | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/spec/text-editor-element-spec.coffee b/spec/text-editor-element-spec.coffee index 0677f0284..a85070ef0 100644 --- a/spec/text-editor-element-spec.coffee +++ b/spec/text-editor-element-spec.coffee @@ -269,23 +269,21 @@ describe "TextEditorElement", -> describe "on TextEditor::onDidChangeAutoHeight", -> it "changes the element's height", -> - element = new TextEditorElement - jasmine.attachToDOM(element) - expect(element.style.height).toBe('') - element.getModel().setAutoHeight(false) + editor = atom.workspace.buildTextEditor() + jasmine.attachToDOM(editor.element) + expect(editor.element.style.height).toBe('') waitsForPromise -> - atom.views.getNextUpdatePromise() + editor.update({autoHeight: false}) runs -> - expect(element.style.height).toBe('100%') - element.getModel().setAutoHeight(true) + expect(editor.element.style.height).toBe('100%') waitsForPromise -> - atom.views.getNextUpdatePromise() + editor.update({autoHeight: true}) runs -> - expect(element.style.height).toBe('') + expect(editor.element.style.height).toBe('') describe "events", -> element = null