Skip to content

Commit

Permalink
🐛 Fix deprecations in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
abe33 committed Oct 30, 2015
1 parent 0bd0734 commit 3bb81d3
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
5 changes: 2 additions & 3 deletions spec/minimap-element-spec.coffee
Original file line number Diff line number Diff line change
@@ -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'
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
5 changes: 2 additions & 3 deletions spec/minimap-main-spec.coffee
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
{TextEditor} = require 'atom'
Minimap = require '../lib/minimap'

describe 'Minimap package', ->
Expand Down Expand Up @@ -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)

Expand Down Expand Up @@ -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)

Expand Down
5 changes: 2 additions & 3 deletions spec/minimap-spec.coffee
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
fs = require 'fs-plus'
{TextEditor} = require 'atom'
Minimap = require '../lib/minimap'

describe 'Minimap', ->
Expand All @@ -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)
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 3bb81d3

Please sign in to comment.