 helpers = Trix.TestHelpers
-
-initialized = false
-initializedCallbacks = []
-
-document.addEventListener "trix-initialize", ->
-  initialized = true
-  callback() while callback = initializedCallbacks.shift()
-
-ready = (callback) ->
-  if initialized
-    callback()
-  else
-    initializedCallbacks.push(callback)
 
 setFixtureHTML = (html) ->
   element = findOrCreateTrixContainer()

      callback = options

    beforeEach = ->
      if template?
        initialized = false
        setFixtureHTML(JST["test_helpers/fixtures/#{template}"]())
      else
        initialized = true
      setup?()

    afterEach = ->

    document.body.insertAdjacentHTML("afterbegin", """<form id="trix-container"></form>""")
    document.getElementById("trix-container")

ready = null

helpers.extend
  testGroup: (name, options, callback) ->
    if callback?
