angular-cn/packages/router/test
Jason Aden 0fd9d086e4 fix(router): ensure navigations start with the current URL value incase redirect is skipped (#30344)
In some cases where multiple navigations happen to the same URL, the router will not process a given URL. In those cases, we fall into logic that resets state for the next navigation. One piece of this resetting is to set the `browserUrlTree` to the most recent `urlAfterRedirects`i.

However, there was bug in this logic because in some cases the `urlAfterRedirects` is a stale value. This happens any time a URL won't be processed, and the previous URL will also not be processed. This creates unpredictable behavior, not the least of which ends up being a broken `back` button.

This PR kicks off new navigations with the current value the router assumes is in the browser. All the logic around how to handle future navigations is based on this value compared to the current transition, so it's important to kick off all new navigations with the current value so in the edge case described above we don't end up with an old value being set into `browserUrlTree`.

Fixes #30340
Related to #30160

PR Close #30344
2019-05-15 10:14:47 -07:00
..
aot_ngsummary_test build: rules_nodejs 0.26.0 & use @npm instead of @ngdeps now that downstream angular build uses angular bundles (#28871) 2019-02-28 12:06:36 -08:00
operators test(ivy): run router tests with ivy on CI (#27195) 2018-11-21 09:19:40 -08:00
utils build: add bazel test rules for remainder of packages (#21053) 2017-12-22 13:10:51 -08:00
BUILD.bazel build: rules_nodejs 0.26.0 & use @npm instead of @ngdeps now that downstream angular build uses angular bundles (#28871) 2019-02-28 12:06:36 -08:00
apply_redirects.spec.ts feat(router): add UrlSegment[] to CanLoad interface (#13127) 2018-08-16 16:32:18 -07:00
bootstrap.spec.ts refactor: move DOCUMENT imports from platform-browser to common (#29237) 2019-03-14 16:01:57 -04:00
config.spec.ts fix(router): fix lazy loading of aux routes (#23459) 2018-06-13 11:20:20 -07:00
create_router_state.spec.ts build: upgrade jasmine (and related typings) to latest version (#19904) 2018-07-06 13:48:02 -07:00
create_url_tree.spec.ts Revert "fix(router): change processing url tree children condition (#26243)" (#27516) 2018-12-06 09:17:20 -08:00
helpers.ts feat(router): allow guards to return UrlTree as well as boolean (#26521) 2018-10-31 19:51:50 -04:00
integration.spec.ts fix(router): ensure navigations start with the current URL value incase redirect is skipped (#30344) 2019-05-15 10:14:47 -07:00
recognize.spec.ts Revert "fix(router): process empty path segment when preceding a named outlet (#26243)" (#27516) 2018-12-06 09:17:20 -08:00
regression_integration.spec.ts test(ivy): run more router tests in CI (#27325) 2018-11-30 14:58:22 -08:00
router.spec.ts test(ivy): run router tests with ivy on CI (#27195) 2018-11-21 09:19:40 -08:00
router_preloader.spec.ts fix(ivy): align NgModuleRef implementation between Ivy and ViewEngine (#27482) 2018-12-06 13:35:08 -08:00
router_scroller.spec.ts fix(router): default scroll position restoration to disabled (#25586) 2018-08-21 10:48:14 -07:00
router_state.spec.ts build(bazel): fix router test failure (#29375) 2019-03-19 23:39:37 -04:00
shared.spec.ts style: typos fixed - https://github.com/vlajos/misspell-fixer (#22975) 2018-03-27 14:51:53 -04:00
spy_ng_module_factory_loader.spec.ts test(ivy): run router tests with ivy on CI (#27195) 2018-11-21 09:19:40 -08:00
url_serializer.spec.ts fix(router): correct the segment parsing so it won't break on ampersand (#23684) 2018-05-10 07:53:53 -07:00
url_tree.spec.ts style: typos fixed - https://github.com/vlajos/misspell-fixer (#22975) 2018-03-27 14:51:53 -04:00