From d53f97ecfe8dbf3e72592fac57be8e33a506e176 Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Mon, 12 May 2014 15:18:28 -0600 Subject: [PATCH] Fix horizontal scrolling spec --- spec/editor-component-spec.coffee | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/spec/editor-component-spec.coffee b/spec/editor-component-spec.coffee index 684a0ed25..22aef3aab 100644 --- a/spec/editor-component-spec.coffee +++ b/spec/editor-component-spec.coffee @@ -524,16 +524,18 @@ describe "EditorComponent", -> editor.setScrollTop(10) expect(verticalScrollbarNode.scrollTop).toBe 10 - it "updates the horizontal scrollbar and scroll view content x transform based on the scrollLeft of the model", -> + it "updates the horizontal scrollbar and the x transform of the lines based on the scrollLeft of the model", -> node.style.width = 30 * charWidth + 'px' component.measureHeightAndWidth() - scrollViewContentNode = node.querySelector('.scroll-view-content') - expect(scrollViewContentNode.style['-webkit-transform']).toBe "translate3d(0px, 0px, 0)" + lineNodes = node.querySelectorAll('.line') + expect(lineNodes[0].style['-webkit-transform']).toBe "translate3d(0px, 0px, 0px)" + expect(lineNodes[4].style['-webkit-transform']).toBe "translate3d(0px, #{4 * lineHeightInPixels}px, 0px)" expect(horizontalScrollbarNode.scrollLeft).toBe 0 editor.setScrollLeft(100) - expect(scrollViewContentNode.style['-webkit-transform']).toBe "translate3d(-100px, 0px, 0)" + expect(lineNodes[0].style['-webkit-transform']).toBe "translate3d(-100px, 0px, 0px)" + expect(lineNodes[4].style['-webkit-transform']).toBe "translate3d(-100px, #{4 * lineHeightInPixels}px, 0px)" expect(horizontalScrollbarNode.scrollLeft).toBe 100 it "updates the scrollLeft of the model when the scrollLeft of the horizontal scrollbar changes", ->