I have a rather special use case: I have an input field that issues a request when a user stops printing for 500 ms. It is designed as a multiple supplement.
I would like to write an acceptance test for this, but I cannot pass the tests correctly. The first passes, the second does not.
Ember runloop now has a nice description, but this behavior is really "something else."
This is my assistant for runloop timeout:
import Ember from 'ember';
export default Ember.Test.registerAsyncHelper('pauseFor', function (time) {
return Ember.Test.promise(function (resolve) {
Ember.run.later(resolve, time);
});
});
Run codeHide resultAnd this is how I use it
it('should do something after 500ms', function () {
visit('/');
fillIn('.search-input', 'a');
pauseFor(500);
andThen(function () {
});
});
Run codeHide resultThis is the error I get:

The strange thing is that I have 2 test cases, and the first one runs happily.
I think my question is: How to do it right? What am I missing here or what am I doing wrong? How can I just just skip the test?
Thanks for the stop!