Skip to content

Commit

Permalink
✅ Add tests for controls size and position with minimap on left
Browse files Browse the repository at this point in the history
  • Loading branch information
abe33 committed Feb 15, 2015
1 parent c79dbb8 commit 14b32d0
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions spec/minimap-element-spec.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -728,10 +728,21 @@ describe 'MinimapElement', ->
expect(controlsRect.right).toEqual(canvasRect.right)

describe 'when the displayMinimapOnLeft setting is enabled', ->
beforeEach ->
atom.config.set('minimap.displayMinimapOnLeft', true)
nextAnimationFrame()

it 'adjusts the size of the control div to fit in the minimap', ->
expect(controls.clientWidth).toEqual(minimapElement.canvas.clientWidth)

it 'positions the controls div over the canvas', ->
controlsRect = controls.getBoundingClientRect()
canvasRect = minimapElement.canvas.getBoundingClientRect()
expect(controlsRect.left).toEqual(canvasRect.left)
expect(controlsRect.right).toEqual(canvasRect.right)

describe 'clicking on the div', ->
beforeEach ->
atom.config.set('minimap.displayMinimapOnLeft', true)

workspaceElement = atom.views.getView(atom.workspace)
jasmineContent.appendChild(workspaceElement)

Expand Down

0 comments on commit 14b32d0

Please sign in to comment.