angular-docs-cn/packages/router/test
Andrew Scott d3a817549b fix(router): fix navigation ignoring logic to compare to the browser url (#37408)
This PR changes the logic for determining when to skip route processing from
using the URL of the last attempted navigation to the actual resulting URL after
that transition.

Because guards may prevent navigation and reset the browser URL, the raw
URL of the previous transition may not match the actual URL of the
browser at the end of the navigation process. For that reason, we need to use
`urlAfterRedirects` instead.

Other notes:
These checks in scheduleNavigation were added in eb2ceff4ba
The test still passes and, more surprisingly, passes if the checks are removed
completely. There have likely been changes to the navigation handling that
handle the test in a different way. That said, it still appears to be important
to keep the checks there in some capacity because it does affect how many
navigation events occur. This addresses an issue that came up in #16710: https://github.com/angular/angular/issues/16710#issuecomment-634869739
This also partially addresses #13586 in fixing history for imperative
navigations that are cancelled by guards.

PR Close #37408
2020-06-11 19:03:40 -07:00
..
aot_ngsummary_test build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
operators build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
utils build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
BUILD.bazel test(router): fix router test failing on IE (#36742) 2020-04-23 12:13:27 -04:00
apply_redirects.spec.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
bootstrap.spec.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
config.spec.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
create_router_state.spec.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
create_url_tree.spec.ts fix(router): Fix relative link generation from empty path components (#37446) 2020-06-08 17:15:37 -07:00
helpers.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
integration.spec.ts fix(router): fix navigation ignoring logic to compare to the browser url (#37408) 2020-06-11 19:03:40 -07:00
recognize.spec.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
regression_integration.spec.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
router.spec.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
router_preloader.spec.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
router_scroller.spec.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
router_state.spec.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
shared.spec.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
spy_ng_module_factory_loader.spec.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
url_serializer.spec.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
url_tree.spec.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00