       nextAnimationFrame()
 
     it 'creates a selection with the cells from the mouse movements', ->
-      startCell = tableShadowRoot.querySelectorAll('.table-edit-row:nth-child(4) .table-edit-cell:nth-child(1)')
-      endCell = tableShadowRoot.querySelectorAll('.table-edit-row:nth-child(7) .table-edit-cell:nth-child(2)')
+      startCell = tableShadowRoot.querySelector('.table-edit-row:nth-child(4) .table-edit-cell:nth-child(1)')
+      endCell = tableShadowRoot.querySelector('.table-edit-row:nth-child(7) .table-edit-cell:nth-child(2)')
 
       mousedown(startCell)
       mousemove(endCell)

      expect(tableElement.getSelection()).toEqual([[3,0],[6,2]])

    it 'scrolls the view when the selection reach the last row', ->
      startCell = tableShadowRoot.querySelectorAll('.table-edit-row:nth-child(7) .table-edit-cell:nth-child(1)')
      endCell = tableShadowRoot.querySelectorAll('.table-edit-row:nth-child(10) .table-edit-cell:nth-child(3)')

      mousedown(startCell)
      mousemove(endCell)

      expect(tableElement.body.scrollTop()).toBeGreaterThan(0)

    it 'scrolls the view when the selection reach the first row', ->
      tableElement.scrollTop(300)
      nextAnimationFrame()

      startCell = tableShadowRoot.querySelectorAll('.table-edit-row:nth-child(12) .table-edit-cell:nth-child(1)')
      endCell = tableShadowRoot.querySelectorAll('.table-edit-row:nth-child(9) .table-edit-cell:nth-child(3)')

      mousedown(startCell)
      mousemove(endCell)

      expect(tableElement.body.scrollTop()).toBeLessThan(300)

  describe 'when the columns widths have been changed', ->
    beforeEach ->


      atom.commands.dispatch(tableElement, 'core:select-down')

      expect(tableElement.body.scrollTop).not.toEqual(0)

    describe 'then triggering core:select-up', ->
      it 'collapse the selection back to the bottom', ->
