lundi 6 juin 2016

Acceptance testing file uploads

I'm using jQuery File Upload as a ember component. This plugin has an API which lets me interact with file uploads programmatically in tests. This works perfectly in component tests. However in Acceptance tests I get this error:

Assertion Failed: You have turned on testing mode, which disabled the run-loop's autorun. You will need to wrap any code with asynchronous side-effects in a run

A snippet from my test:

// some steps before this.

andThen(() => {
  Ember.run(() => {
     find('.file-upload').fileupload('send', { files: [{name: 'file.doc' }] });
    });
  });
});

Any pointers would be much appreciated.




Aucun commentaire:

Enregistrer un commentaire