Add a spec to verify gutter decorations are updated even if a higher priority gutter is hidden.

This commit is contained in:
Natthu Bharambe
2015-08-26 15:17:03 -07:00
parent 4ffb8fae27
commit aba76015b0

View File

@@ -2300,6 +2300,15 @@ describe "TextEditorPresenter", ->
expect(decorationState[decoration3.id]).toBeUndefined()
it "updates when another gutter with higher priority is hidden", ->
editor.addGutter({name: 'test-gutter-1', priority: -150, visible: false})
# This update will scroll decoration1 out of view, and decoration3 into view.
expectStateUpdate presenter, -> presenter.setScrollTop(scrollTop + lineHeight * 5)
decorationState = getContentForGutterWithName(presenter, 'test-gutter')
expect(decorationState[decoration1.id]).toBeUndefined()
it "updates when ::scrollTop changes", ->
# This update will scroll decoration1 out of view, and decoration3 into view.
expectStateUpdate presenter, -> presenter.setScrollTop(scrollTop + lineHeight * 5)