               expect(addDialog.errorMessage.textContent).toContain 'already exists'
               expect(addDialog.element).toHaveClass('error')
               expect(atom.workspace.getModalPanels()[0]).toBe addPanel
-              expect(handlers['file-created'][0]).not.toHaveBeenCalled()
+              expect(callback).not.toHaveBeenCalled()
 
           describe "when the project has no path", ->
             it "adds a file and closes the dialog", ->

              expect(fs.existsSync(path.join(dirPath, "test-file30.txt"))).toBeTruthy()

      describe "when a file has been cut", ->
        handlers = null

        beforeEach ->
          LocalStorage['tree-view:cutPath'] = JSON.stringify([filePath])
          handlers = treeView.emitter.handlersByEventName
          treeView.onEntryMoved ->
          spyOn(handlers['entry-moved'], '0')

        describe "when a file is selected", ->
          it "creates a copy of the original file in the selected file's parent directory and removes the original", ->
            LocalStorage['tree-view:cutPath'] = JSON.stringify([filePath])

            fileView2.dispatchEvent(new MouseEvent('click', {bubbles: true, detail: 1}))
            atom.commands.dispatch(treeView.element, "tree-view:paste")

            expect(fs.existsSync(path.join(dirPath2, path.basename(filePath)))).toBeTruthy()
            expect(fs.existsSync(filePath)).toBeFalsy()
            expect(handlers['entry-moved'][0].callCount).toEqual(1)

          describe 'when the target destination file exists', ->
            it 'does not move the cut file', ->
              filePath3 = path.join(dirPath2, "test-file.txt")
              fs.writeFileSync(filePath3, "doesn't matter")


                dirView.entries.querySelectorAll(".file").length > 1

              runs ->
                expect(treeView.element.querySelector('.selected').textContent).toBe path.basename(newPath)
                expect(callback).toHaveBeenCalledWith({path: newPath})

            it "adds file in any project path", ->
              newPath = path.join(dirPath3, "new-test-file.txt")
