 
     describe "when the original preview is split", ->
       it "renders another preview in the new split pane", ->
-        getCenter().getPanes()[1].splitRight({copyActiveItem: true})
-
-        expect(getCenter().getPanes()).toHaveLength 3
+        atom.workspace.getCenter().getPanes()[1].splitRight({copyActiveItem: true})
+
+        expect(atom.workspace.getCenter().getPanes()).toHaveLength 3
 
         waitsFor "split markdown preview to be created", ->
-          preview = getCenter().getPanes()[2].getActiveItem()
+          preview = atom.workspace.getCenter().getPanes()[2].getActiveItem()
 
         runs ->
           expect(preview).toBeInstanceOf(MarkdownPreviewView)

      describe "when the preview is not the active item and not in the active pane", ->
        it "re-renders the preview and makes it active", ->
          markdownEditor = atom.workspace.getActiveTextEditor()
          [editorPane, previewPane] = getCenter().getPanes()
          previewPane.splitRight(copyActiveItem: true)
          previewPane.activate()


wrench = require 'wrench'
MarkdownPreviewView = require '../lib/markdown-preview-view'

describe "Markdown preview package", ->
  [workspaceElement, preview] = []

