-
Notifications
You must be signed in to change notification settings - Fork 601
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
QUnit integration test hangs during route transition #35
Comments
It's a little hard to help without having access to the code. Accessing the login route shouldn't actually trigger anything in Ember.SimpleAuth though. Also I'm not sure which init function you're talking about. As a side note (though I don't think that's causing your problem): |
I'm having the same issue and I've narrowed it down to a simple test case: https://github.com/matthooks/ember-karma-simple-auth-issue Run |
Looks like it's something to do with this line: https://github.com/simplabs/ember-simple-auth/blob/310abd1aea9f9b5254975c3f494fd59bfbc5ac9b/packages/ember-simple-auth/lib/session.js#L86 |
I think the problem is the use of Ember.run.later somehow breaks testing. Probably best to disable it in testing mode... |
I'm still digging to figure out why that line is breaking things. The plugin seems to work fine without it. What's the intention of that run.later call? |
The |
Since I arrived with this exact same problem, I believe I can provide more info for future visitors, even knowing that this issue has already been addressed. Most of the actions that Ember.testing executes (like Along with the things that are tested for, pending AJAX requests are verified, and also scheduled timers. These timers may arise from, you guessed it, I've faced it myself in a similar scenario: My server returns a OAuth access token with 100 hours until expired, so ember-simpleAuth registers a call close to the expiration time with Hope this helps to anyone with this issue, and sorry for the wall of text. |
Hello and thank you. This problem has not been fixed, yet. |
@AlphaGit thanks for the great write up. Unfortunately just recognized it today. Should we disable automatic token refreshing in testing mode? |
@marcoow I think that's a fair approach. I don't think anyone would be relying on that feature for test scenarios. |
@AlphaGit +1 I have just hotfixed it by commenting the line while testing :) |
ember-simple-auth config:
The Test:
The problem:
The test hangs during the route transition.
Hangs right here
The test will finish if I override the init function in simple-auth and strip out the body of that function. I think maybe there is an async call in init that isn't resolving or something?
Other than this test failing, ember-simple-auth is working as expected. All protected routes require login and the session object is being returned correctly.
FYI this is within an ember app kit project.
The text was updated successfully, but these errors were encountered: