           runs ->
             editorElement = atom.views.getView(atom.workspace.getActivePaneItem())
             atom.commands.dispatch(editorElement, "tree-view:duplicate")
-            copyDialog = $(atom.workspace.getModalPanels()[0].getItemView()).view()
+            copyDialog = $(atom.workspace.getModalPanels()[0].getItem()).view()
 
         it "duplicates the current file", ->
           expect(copyDialog.miniEditor.getText()).toBe('tree-view.js')

          addDialog.cancel()
          dirView.click()
          atom.commands.dispatch(treeView.element, "tree-view:add-file")
          addDialog = $(atom.workspace.getModalPanels()[0].getItemView()).view()

          expect(addDialog).toExist()
          expect(addDialog.promptText.text()).toBeTruthy()


        runs ->
          atom.commands.dispatch(treeView.element, "tree-view:add-file")
          addDialog = $(atom.workspace.getModalPanels()[0].getItem()).view()

      describe "when a file is selected", ->
        it "opens an add dialog with the file's current directory path populated", ->
