Test decorateMarker + decorationStateForScreenRowRange

This commit is contained in:
Nathan Sobo
2015-10-26 19:03:19 -06:00
parent 9d6168aac8
commit 7d22ed788c

View File

@@ -5599,3 +5599,13 @@ describe "TextEditor", ->
gutter.destroy()
expect(payloads).toEqual []
describe "decorations", ->
describe "::decorateMarker", ->
it "includes the decoration in the object returned from ::decorationStateForScreenRowRange", ->
marker = editor.markBufferRange([[2, 4], [6, 8]])
decoration = editor.decorateMarker(marker, type: 'highlight', class: 'foo')
expect(editor.decorationStateForScreenRowRange(0, 5)[decoration.id]).toEqual {
properties: {type: 'highlight', class: 'foo', id: decoration.id}
screenRange: marker.getScreenRange(),
rangeIsReversed: false,
}