 fonts_cjk = require('../lib/fonts-cjk')
 
 describe 'Fonts CJK', ->
-  [workspaceElement] = []
+  [textEditorElement, workspaceElement] = []
 
   getFontFamily = (selector) ->
     element = if selector then workspaceElement.querySelector(selector) else workspaceElement

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


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