From aba76015b0b28d476186eed25844989f1761fe3c Mon Sep 17 00:00:00 2001 From: Natthu Bharambe Date: Wed, 26 Aug 2015 15:17:03 -0700 Subject: [PATCH] Add a spec to verify gutter decorations are updated even if a higher priority gutter is hidden. --- spec/text-editor-presenter-spec.coffee | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/spec/text-editor-presenter-spec.coffee b/spec/text-editor-presenter-spec.coffee index f37044421..17140a18b 100644 --- a/spec/text-editor-presenter-spec.coffee +++ b/spec/text-editor-presenter-spec.coffee @@ -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)