 
     describe "tree-view:open-selected-entry", ->
       describe "when a file is selected", ->
+        beforeEach ->
+          rootView.attachToDom()
+
         it "opens the file in the editor and focuses it", ->
           waitsForFileToOpen ->
             treeView.root.find('.file:contains(tree-view.js)').click()

      addDialog = null

      beforeEach ->
        waitsForFileToOpen ->
          fileView.click()


        moveDialog = null

        beforeEach ->
          rootView.attachToDom()

          waitsForFileToOpen ->
            fileView.click()

