 
     it "does not apply .cursor-line to the last line of a selection if it's empty", ->
       editor.setSelectedScreenRange([[3, 4], [5, 0]])
-      waitsForPromise -> atom.views.getNextUpdatePromise()
+      waitsForNextDOMUpdate()
       runs ->
         expect(lineNumberHasClass(3, 'cursor-line')).toBe true
         expect(lineNumberHasClass(4, 'cursor-line')).toBe true


      it "updates the indent guides on empty lines preceding an indentation change", ->
        editor.getBuffer().insert([12, 0], '\n')
        waitsForPromise -> atom.views.getNextUpdatePromise()

        runs ->
          editor.getBuffer().insert([13, 0], '    ')

        waitsForPromise -> atom.views.getNextUpdatePromise()

        runs ->
          line12LeafNodes = getLeafNodes(component.lineNodeForScreenRow(12))


    it "removes highlights when a decoration is removed", ->
      decoration.destroy()
      waitsForNextDOMUpdate()

      runs ->
        regions = componentNode.querySelectorAll('.test-highlight .region')
