diff --git a/spec/minimap-element-spec.coffee b/spec/minimap-element-spec.coffee index bec5ed9a..ba1565ea 100644 --- a/spec/minimap-element-spec.coffee +++ b/spec/minimap-element-spec.coffee @@ -1,6 +1,5 @@ fs = require 'fs-plus' path = require 'path' -{TextEditor} = require 'atom' Minimap = require '../lib/minimap' MinimapElement = require '../lib/minimap-element' {mousemove, mousedown, mouseup, mousewheel, touchstart, touchmove} = require './helpers/events' @@ -39,7 +38,7 @@ describe 'MinimapElement', -> MinimapElement.registerViewProvider() - editor = new TextEditor({}) + editor = atom.workspace.buildTextEditor({}) editorElement = atom.views.getView(editor) jasmineContent.insertBefore(editorElement, jasmineContent.firstChild) editorElement.setHeight(50) @@ -815,7 +814,7 @@ describe 'MinimapElement', -> describe 'when the minimap is not attached yet', -> beforeEach -> - editor = new TextEditor({}) + editor = atom.workspace.buildTextEditor({}) editorElement = atom.views.getView(editor) editorElement.setHeight(50) editor.setLineHeightInPixels(10) diff --git a/spec/minimap-main-spec.coffee b/spec/minimap-main-spec.coffee index d489825b..be629e8a 100644 --- a/spec/minimap-main-spec.coffee +++ b/spec/minimap-main-spec.coffee @@ -1,4 +1,3 @@ -{TextEditor} = require 'atom' Minimap = require '../lib/minimap' describe 'Minimap package', -> @@ -26,7 +25,7 @@ describe 'Minimap package', -> workspaceElement.querySelector('atom-text-editor::shadow atom-text-editor-minimap') it 'registers the minimap views provider', -> - textEditor = new TextEditor({}) + textEditor = atom.workspace.buildTextEditor({}) minimap = new Minimap({textEditor}) minimapElement = atom.views.getView(minimap) @@ -76,7 +75,7 @@ describe 'Minimap package', -> expect(minimapPackage.provideMinimapServiceV1()).toEqual(minimapPackage) it 'creates standalone minimap with provided text editor', -> - textEditor = new TextEditor({}) + textEditor = atom.workspace.buildTextEditor({}) standaloneMinimap = minimapPackage.standAloneMinimapForEditor(textEditor) expect(standaloneMinimap.getTextEditor()).toEqual(textEditor) diff --git a/spec/minimap-spec.coffee b/spec/minimap-spec.coffee index 44020938..bf99a34a 100644 --- a/spec/minimap-spec.coffee +++ b/spec/minimap-spec.coffee @@ -1,5 +1,4 @@ fs = require 'fs-plus' -{TextEditor} = require 'atom' Minimap = require '../lib/minimap' describe 'Minimap', -> @@ -10,7 +9,7 @@ describe 'Minimap', -> atom.config.set 'minimap.charWidth', 2 atom.config.set 'minimap.interline', 1 - editor = new TextEditor({}) + editor = atom.workspace.buildTextEditor({}) editorElement = atom.views.getView(editor) jasmine.attachToDOM(editorElement) @@ -362,7 +361,7 @@ describe 'Stand alone minimap', -> atom.config.set 'minimap.charWidth', 2 atom.config.set 'minimap.interline', 1 - editor = new TextEditor({}) + editor = atom.workspace.buildTextEditor({}) editorElement = atom.views.getView(editor) jasmine.attachToDOM(editorElement) editorElement.setHeight(50)