 Minimap = require '../lib/minimap'
 
 describe 'Minimap', ->
-  [editor, editorElement, minimap, largeSample, smallSample] = []
+  [editor, editorElement, minimap, largeSample, smallSample, minimapVerticalScaleFactor, minimapHorizontalScaleFactor] = []
 
   beforeEach ->
     atom.config.set 'minimap.charHeight', 4

    jasmine.attachToDOM(editorElement)
    editorElement.setHeight(50)
    editorElement.setWidth(200)
    editor.setLineHeightInPixels(10)

    dir = atom.project.getDirectories()[0]


      editorScrollRatio = editorElement.getScrollTop() / (editorElement.getScrollHeight() - editorElement.getHeight())

    it 'scales the editor scroll based on the minimap scale factor', ->
      expect(minimap.getTextEditorScaledScrollTop()).toEqual(1000 * minimapVerticalScaleFactor)
      expect(minimap.getTextEditorScaledScrollLeft()).toEqual(200 * minimapHorizontalScaleFactor)

    it 'computes the offset to apply based on the editor scroll top', ->
      expect(minimap.getScrollTop()).toEqual(editorScrollRatio * minimap.getMaxScrollTop())
