       runs -> expect(pane.activate.callCount).toBe 2
 
     it "closes the tab when middle clicked", ->
+      jasmine.attachToDOM(tabBar) # Remove after Atom 1.2.0 is released
+
       event = triggerMouseEvent('mousedown', tabBar.tabForItem(editor1), which: 2)
 
       expect(pane.getItems().length).toBe 2


  describe "when a tab is clicked", ->
    it "shows the associated item on the pane and focuses the pane", ->
      spyOn(pane, 'activate')

      event = triggerMouseEvent('mousedown', tabBar.tabAtIndex(0), which: 1)

      expect(event.preventDefault).toHaveBeenCalled()

    it "doesn't switch tab when right (or ctrl-left) clicked", ->
      jasmine.attachToDOM(tabBar) # Remove after Atom 1.2.0 is released

      spyOn(pane, 'activate')

      event = triggerMouseEvent('mousedown', tabBar.tabAtIndex(0), which: 3)
