-
-
Notifications
You must be signed in to change notification settings - Fork 113
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Acceptance tests halt due to run.later scheduling #32
Comments
I've run into the same issue when trying to test the mouseover-ed feature. if the test should lead to
or that being said... I haven't had time to try coding it since I thought about it and maybe it is a rubbish idea 😄 |
A declarative public API for testing would be lovely. This isn’t a serious suggestion, but food for thought: test('say hello', function(assert) {
visit('/');
click('button:contains("Say hello"));
pauseFlashes();
andThen(() => { assert.equal(find(':contains("Hiya")').length, 1); });
flushFlashes();
andThen(() => { assert.equal(find(':contains("Hiya")').length, 0); });
}); |
Thanks for reporting this @jgwhite and @leojpod! Yeah, it is definitely a problem I want to fix. I like the idea of being able to pause / flush flashes in testing, but I think I'd prefer for the flashes to just work in testing (without additional helpers) in a way that you'd expect. I'll investigate over the next few days to figure out the best approach. |
Here is another idea. I have Ember.get(this, 'flashMessages').add({
message: 'Custom message',
sticky: ENV.stickyFlash
}); This just explicitly sets sticky to the already default |
Using Mocha, the From my perspective, the most intuitive approach is to treat flashes as always sticky in test. That's because I almost always want to assert that they were shown, but I have complete faith that if I told Based on that, I think @jgwhite's workaround is the simplest, least surprising option, and I'd consider making it automatic. That way you spend basically zero mental overhead thinking about how your flashes might work differently in test than in development and production. |
Yeah, that's a good point @cowboyd, I like that approach and I'm gonna work on implementing that and the helper. @JarrodCTaylor you can also set |
Given the following app:
An acceptance test has the following behaviour:
This is tricky both because
andThen
behaves unintuitively and because the test will pause for the full timeout duration.I’ve worked around this in my tests with a total hack:
This is obviously not ideal but I’m struggling to come up with a reasonable API for this scenario. Any thoughts?
P.S. Love this addon so much ❤️
The text was updated successfully, but these errors were encountered: