 PaneContainer = require '../src/pane-container'
 
 describe "PaneElement", ->
-  [paneElement, container, containerElement, pane] = []
+  [paneElement, containerElement, pane] = []
 
   beforeEach ->
     spyOn(atom.applicationDelegate, "open")
 
-    container = new PaneContainer
-      location: 'center'
-      config: atom.config
-      confirm: atom.confirm.bind(atom)
-      viewRegistry: atom.views
-      applicationDelegate: atom.applicationDelegate
-    containerElement = container.getElement()
+    container = atom.workspace.getActivePaneContainer()
+    containerElement = container.paneContainer.getElement()
     pane = container.getActivePane()
     paneElement = pane.getElement()
 


    describe "when a file is dragged to the pane", ->
      it "opens it", ->
        event = buildDragEvent("drop", [{path: "/fake1"}, {path: "/fake2"}])
        paneElement.dispatchEvent(event)
        expect(atom.applicationDelegate.open.callCount).toBe 1
        expect(atom.applicationDelegate.open.argsForCall[0][0]).toEqual pathsToOpen: ['/fake1', '/fake2'], here: true

      expect(document.activeElement).toBe paneElement

  describe "drag and drop", ->
    buildDragEvent = (type, items) ->
      dataTransfer =
        items: items
        data: {}
        setData: (key, value) -> @data[key] = value
        getData: (key) -> @data[key]
