Skip to content

Commit

Permalink
✅ Add tests for highlight decorations render
Browse files Browse the repository at this point in the history
  • Loading branch information
abe33 committed Dec 16, 2014
1 parent be47f93 commit cb3c9b0
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions spec/minimap-element-spec.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,19 @@ describe 'MinimapElement', ->
expect(minimapElement.drawLineDecorations).toHaveBeenCalled()
expect(minimapElement.drawLineDecorations.calls.length).toEqual(2)

it 'renders the visible highlight decorations', ->
spyOn(minimapElement, 'drawHighlightDecoration').andCallThrough()

minimap.decorateMarker(editor.markBufferRange([[1,0], [1,4]]), type: 'highlight-under', color: '#0000FF')
minimap.decorateMarker(editor.markBufferRange([[2,20], [2,30]]), type: 'highlight-over', color: '#0000FF')
minimap.decorateMarker(editor.markBufferRange([[100,3], [100,5]]), type: 'highlight-under', color: '#0000FF')

editor.setScrollTop(0)
nextAnimationFrame()

expect(minimapElement.drawHighlightDecoration).toHaveBeenCalled()
expect(minimapElement.drawHighlightDecoration.calls.length).toEqual(2)

describe 'when the editor is scrolled', ->
beforeEach ->
editor.setScrollTop(2000)
Expand Down

0 comments on commit cb3c9b0

Please sign in to comment.