 
     describe 'core:cancel', ->
       it 'closes the editor', ->
-        editor.trigger('core:cancel')
+        atom.commands.dispatch(editor.element, 'core:cancel')
         expect(tableView.isEditing()).toBeFalsy
 
     describe 'table-edit:move-right', ->

      describe 'when the content of the editor has changed', ->
        beforeEach ->
          editor.setText('foobar')
          editor.trigger('core:confirm')

        it 'closes the editor', ->
          expect(tableView.find('atom-text-editor:visible').length).toEqual(0)

      tableView.activateCellAtPosition([2,0])

    it 'expands the selection by one cell to the top', ->
      atom.commands.dispatch(tableView.element, 'core:select-up')
      expect(tableView.getSelection()).toEqual([[1,0],[2,0]])

    it 'stops at the first row', ->
      atom.commands.dispatch(tableView.element, 'core:select-up')
      atom.commands.dispatch(tableView.element, 'core:select-up')
      atom.commands.dispatch(tableView.element, 'core:select-up')
      expect(tableView.getSelection()).toEqual([[0,0],[2,0]])

    it 'scrolls the view to make the added row visible', ->
      tableView.scrollTop(200)
      tableView.activateCellAtPosition([10,0])

      atom.commands.dispatch(tableView.element, 'core:select-up')

      expect(tableView.body.scrollTop()).toEqual(180)

