-zc.waitfor = (timeout, check) ->
+zc.waitfor = (check, timeout=1000) ->
   t0 = _.now()
   deferred = Q.defer()
 

      el: $app[0]
    )

    zc.waitfor(1000, -> $app.find('.conversation-compose').length or null)
    .then ->
      $form = $app.find('.conversation-compose form')
      $form.find('[name=message]').val('hello world')

        messages = $history.find('.message-text').text()
        return messages if messages.length > 0

      return zc.waitfor(get_messages, 3000)
    .then (messages) ->
      expect(messages).toEqual("hello world")
    .catch (err) ->
