     it "closes the existing preview when toggle is triggered a second time on the editor", ->
       atom.commands.dispatch workspaceElement, 'markdown-preview:toggle'
 
-      [editorPane, previewPane] = getCenter().getPanes()
+      [editorPane, previewPane] = atom.workspace.getCenter().getPanes()
       expect(editorPane.isActive()).toBe true
       expect(previewPane.getActiveItem()).toBeUndefined()
 
     it "closes the existing preview when toggle is triggered on it and it has focus", ->
-      [editorPane, previewPane] = getCenter().getPanes()
+      [editorPane, previewPane] = atom.workspace.getCenter().getPanes()
       previewPane.activate()
 
       atom.commands.dispatch workspaceElement, 'markdown-preview:toggle'

        expect(fs.isFileSync(outputPath)).toBe true

    it "saves the HTML when it is triggered and the preview pane has focus", ->
      [editorPane, previewPane] = getCenter().getPanes()
      previewPane.activate()

      outputPath = temp.path(suffix: '.html')


    describe "when the original preview is split", ->
      it "renders another preview in the new split pane", ->
        atom.workspace.getCenter().getPanes()[1].splitRight({copyActiveItem: true})

        expect(atom.workspace.getCenter().getPanes()).toHaveLength 3

        waitsFor "split markdown preview to be created", ->
          preview = atom.workspace.getCenter().getPanes()[2].getActiveItem()

        runs ->
          expect(preview).toBeInstanceOf(MarkdownPreviewView)
