-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[BUGFIX release] Ensure app booted in visit helper
Problem: There are reported cases of the currentURL helper returning an empty string after the release of 1.12. Tests: The acceptance tests are not currently checking the currentURL after using the visit helper. This adds an assertion for the current url after each currentRoute assertion - the currentRouteName and currentPath helpers are functioning normally and, in these tests, the currentRoute is a var set on transition to a new route so there is a need to specifically check the url. Fix: It turns out that this isn't so much a problem with currentURL as it is the visit helper. When the lazy router location work was completed in 8e130e5 the call to `router.location.setURL()` was moved down in the else case after checking for readiness deferrals. The problem seems to be a timing issue with the call to setupRouter after the application is marked ready. The initialURL, while set, doesn't give us a reliable URL during tests. The call to `app.boot()` ensures the application is booted and ready, the important part for this fix is the call to `advanceReadiness` in boot - it is there that the router and location are set up. After the app is booted the call to `setURL` works as expected. Thanks to @rwjblue for working out the code needed to correct the issue.
- Loading branch information
Showing
2 changed files
with
28 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters