       waitsForPromise ->
         atom.packages.activatePackage('markdown-preview')
       runs ->
-        atom.commands.dispatch(workspaceElement, 'markdown-preview:toggle')
+        atom.commands.dispatch(textEditorElement, 'markdown-preview:toggle')
       waitsFor 'markdown preview to be created', ->
         preview = atom.workspace.getPanes()[1].getActiveItem()
       runs ->

      atom.workspace.open('file.txt')
    runs ->
      fonts_cjk.run()
      workspaceElement = atom.views.getView(atom.workspace)
      jasmine.attachToDOM(workspaceElement)


fonts_cjk = require('../lib/fonts-cjk')

describe 'Fonts CJK', ->
  [textEditorElement, workspaceElement] = []

  getFontFamily = (selector) ->
    element = if selector then workspaceElement.querySelector(selector) else workspaceElement
