Fix specs

This commit is contained in:
Ben Ogle
2014-06-24 17:26:30 -07:00
parent 9cc1244f32
commit 196f64d846
3 changed files with 7 additions and 0 deletions

View File

@@ -1038,6 +1038,7 @@ describe "DisplayBuffer", ->
displayBuffer.manageScrollPosition = true
displayBuffer.setLineHeightInPixels(10)
displayBuffer.setDefaultCharWidth(10)
displayBuffer.updateAllScreenLines()
it "disallows negative values", ->
displayBuffer.setWidth(displayBuffer.getScrollWidth() + 100)
@@ -1062,6 +1063,7 @@ describe "DisplayBuffer", ->
displayBuffer.setHorizontalScrollbarHeight(0)
displayBuffer.setHeight(50)
displayBuffer.setWidth(50)
displayBuffer.updateAllScreenLines()
it "sets the scroll top and scroll left so the given screen position is in view", ->
displayBuffer.scrollToScreenPosition([8, 20])

View File

@@ -62,6 +62,7 @@ describe "EditorComponent", ->
node.style.height = editor.getLineCount() * lineHeightInPixels + 'px'
node.style.width = '1000px'
editor.displayBuffer.updateAllScreenLines()
component.measureScrollView()
nextTick()

View File

@@ -733,6 +733,7 @@ describe "Editor", ->
editor.setHorizontalScrollbarHeight(0)
editor.setHeight(5.5 * 10)
editor.setWidth(5.5 * 10)
editor.displayBuffer.updateAllScreenLines()
it "scrolls down when the last cursor gets closer than ::verticalScrollMargin to the bottom of the editor", ->
expect(editor.getScrollTop()).toBe 0
@@ -1196,6 +1197,8 @@ describe "Editor", ->
editor.setHeight(50)
editor.setWidth(50)
editor.setHorizontalScrollbarHeight(0)
editor.displayBuffer.updateAllScreenLines()
expect(editor.getScrollTop()).toBe 0
editor.setSelectedBufferRange([[5, 6], [6, 8]], autoscroll: true)
@@ -1230,6 +1233,7 @@ describe "Editor", ->
editor.setDefaultCharWidth(10)
editor.setHeight(50)
editor.setWidth(50)
editor.displayBuffer.updateAllScreenLines()
editor.addSelectionForBufferRange([[8, 10], [8, 15]])
expect(editor.getScrollTop()).toBe 75