view page source - page history - about editing

Revision History: Integration Testing with EmberJS and JQuery

This is revision 495 of the page Integration Testing with EmberJS and JQuery, as it appeared on Wed, 30 Apr 2014 19:30:03 -0700.
EmberJS / JQuery

We use mocha and chai and sinon and sinon-chai for testing our EmberJS applications.

If you have functionality that needs to be tested by changing form elements directly (e.g. $()) but requires asynchronous behaviour, such as updating the underlying Ember model, you can use andThen(function) to chain these asynchronous events:

describe 'interface', ->

  it 'can change the underlying model', (done) ->
    @timeout 5e3    # set timeout to 5s

    # visit the application root
    visit '/' ->

      # defaults

      # now change
      $(".time-type").change()  # this will update

      andThen ->
        # should now have changed


Categories: Javascript | Testing | EmberJS

view page source - what links to here? - page history - top
Last edited by jevon jevon 59 months ago