From 0fd8c5441cdec93ad6701e546ed5108fa9d5f693 Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Mon, 7 Apr 2014 17:52:48 -0600 Subject: [PATCH] :lipstick: spec organization --- spec/editor-component-spec.coffee | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/spec/editor-component-spec.coffee b/spec/editor-component-spec.coffee index 2481c239c..fe89c564e 100644 --- a/spec/editor-component-spec.coffee +++ b/spec/editor-component-spec.coffee @@ -26,7 +26,7 @@ describe "EditorComponent", -> {lineHeightInPixels, charWidth} = component.measureLineDimensions() node = component.getDOMNode() - describe "scrolling", -> + describe "line rendering", -> it "renders only the currently-visible lines", -> node.style.height = 4.5 * lineHeightInPixels + 'px' component.updateAllDimensions() @@ -50,16 +50,6 @@ describe "EditorComponent", -> expect(spacers[0].offsetHeight).toBe 2 * lineHeightInPixels expect(spacers[1].offsetHeight).toBe (editor.getScreenLineCount() - 8) * lineHeightInPixels - it "updates the scroll bar when the scrollTop is changed in the model", -> - node.style.height = 4.5 * lineHeightInPixels + 'px' - component.updateAllDimensions() - - scrollbarNode = node.querySelector('.vertical-scrollbar') - expect(scrollbarNode.scrollTop).toBe 0 - - editor.setScrollTop(10) - expect(scrollbarNode.scrollTop).toBe 10 - describe "cursor rendering", -> it "renders the currently visible cursors", -> cursor1 = editor.getCursor() @@ -328,3 +318,13 @@ describe "EditorComponent", -> expect(node.classList.contains('is-focused')).toBe true inputNode.blur() expect(node.classList.contains('is-focused')).toBe false + + it "updates the scroll bar when the scrollTop is changed in the model", -> + node.style.height = 4.5 * lineHeightInPixels + 'px' + component.updateAllDimensions() + + scrollbarNode = node.querySelector('.vertical-scrollbar') + expect(scrollbarNode.scrollTop).toBe 0 + + editor.setScrollTop(10) + expect(scrollbarNode.scrollTop).toBe 10