       addDialog = null
 
       beforeEach ->
+        rootView.attachToDom()
+
         waitsForFileToOpen ->
           fileView.click()
 

        expect(rootView.getActiveView().isFocused).toBeFalsy()

  describe "when a file is double-clicked", ->
    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 })


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