       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

      {lineHeightInPixels, charWidth} = component.measureLineDimensions()
      node = component.getDOMNode()

  describe "scrolling", ->
    it "renders only the currently-visible lines", ->
      node.style.height = 4.5 * lineHeightInPixels + 'px'
      component.updateAllDimensions()

      spacers = node.querySelectorAll('.spacer')
      expect(spacers[0].offsetHeight).toBe 2 * lineHeightInPixels
      expect(spacers[1].offsetHeight).toBe (editor.getScreenLineCount() - 8) * lineHeightInPixels

  describe "cursor rendering", ->
    it "renders the currently visible cursors", ->
