 wrench = require 'wrench'
 MarkdownPreviewView = require '../lib/markdown-preview-view'
 
+# TODO: Remove this after atom/atom#13977 lands in favor of unguarded `getCenter()` calls
+getCenter = -> atom.workspace.getCenter?() ? atom.workspace
+
 describe "Markdown preview package", ->
   [workspaceElement, preview] = []
 

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

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

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

      describe "when the preview is in the active pane but is not the active item", ->
        it "re-renders the preview but does not make it active", ->
          markdownEditor = atom.workspace.getActiveTextEditor()
          previewPane = getCenter().getPanes()[1]
          previewPane.activate()

          waitsForPromise ->
