         expect(rootView.getActiveView().isFocused).toBeFalsy()
 
   describe "when a file is double-clicked", ->
+    beforeEach ->
+      rootView.attachToDom()
+
     it "selects the file and opens it in the active editor on the first click, then changes focus to the active editor on the second", ->
       waitsForFileToOpen ->
         sampleJs.trigger clickEvent(originalEvent: { detail: 1 })

      addDialog = null

      beforeEach ->
        waitsForFileToOpen ->
          fileView.click()



    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()
