     it "gives the cursor a non-zero width even if it's inside atomic tokens", ->
       editor.setCursorScreenPosition([1, 0])
 
-      waitsForPromise -> atom.views.getNextUpdatePromise()
+      waitsForNextDOMUpdate()
 
       runs ->
         cursorNode = componentNode.querySelector('.cursor')

        verticalScrollbarNode.scrollTop = 1 * lineHeightInPixels
        verticalScrollbarNode.dispatchEvent(new UIEvent('scroll'))

      waitsForPromise -> atom.views.getNextUpdatePromise()

      runs ->
        tilesNodes = component.tileNodesForLines()

    it "updates the scrollLeft of the model when the scrollLeft of the horizontal scrollbar changes", ->
      componentNode.style.width = 30 * charWidth + 'px'
      component.measureDimensions()
      waitsForNextDOMUpdate()

      runs ->
        expect(wrapperNode.getScrollLeft()).toBe 0
        horizontalScrollbarNode.scrollLeft = 100
        horizontalScrollbarNode.dispatchEvent(new UIEvent('scroll'))

      waitsForNextDOMUpdate()

      runs ->
        expect(wrapperNode.getScrollLeft()).toBe 100
