angular/packages/router/test
Andrew Scott 2aae92b05f refactor(router): Have router subscribe to transition events to update state (#48427)
Rather than the navigation transitions managing Router state, this
commit updates the Router to manage its own state based on ongoing
transition events. In the future, this can be abstracted even further to
have a totally separate class that manages the Router state. This would
allow the potential for swapping state manager implementations rather
than having to implement all types of state management in a single place.

One finding during tests was that unexpected errors thrown by the state management code moved
to the Router here will no longer be caught by the transition pipe's `catchError`.
This only includes calls to the following public Api methods:

* `go`, `replaceState`, `historyGo`, `isCurrentPathEqualTo` on `Location`
* `UrlSerializer.serialize`
* `UrlHandlingStrategy.merge`.

None of these methods should throw if the router is expected to function.
These might throw when tests include incomplete mocks, which is not
supported, or in cases where the actual browser methods like
`replaceState` would throw. This will already result in unexpected/unsupported
behavior. The failure case here is now arguably better - the navigation
itself still completes but the state update (either updating Router
internal state or updating the browser URL) fails separately and is
unhandled.

PR Close #48427
2023-08-22 08:04:00 -07:00
..
directives refactor(router): Ensure data is bound to components in change detection following navigation (#49741) 2023-04-12 09:33:11 -07:00
operators refactor(router): Remove RouterTestingModule in favor of RouterModule.forRoot (#49427) 2023-04-04 15:12:33 -07:00
utils build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
apply_redirects.spec.ts fix(router): Route matching should only happen once when navigating (#49163) 2023-03-29 14:40:41 -07:00
bootstrap.spec.ts test(router): enable a subset of bootstrapping test to ran on node (#49843) 2023-04-14 14:14:55 -04:00
BUILD.bazel refactor: update packages/router tests to be compatible with ESM (#48521) 2022-12-19 19:50:43 +00:00
computed_state_restoration.spec.ts fix(router): Ensure canceledNavigationResolution: 'computed' works on first page (#51441) 2023-08-21 13:01:58 -07:00
config.spec.ts refactor(router): code cleaning (#48259) 2022-12-09 09:59:20 -08:00
create_router_state.spec.ts fix(router): Route matching should only happen once when navigating (#49163) 2023-03-29 14:40:41 -07:00
create_url_tree.spec.ts fix(router): Apply named outlets to children empty paths not appearing in the URL (#51292) 2023-08-10 09:18:30 -07:00
default_export_component.ts feat(router): auto-unwrap default exports when lazy loading (#47586) 2022-10-04 14:40:58 -07:00
default_export_routes.ts feat(router): auto-unwrap default exports when lazy loading (#47586) 2022-10-04 14:40:58 -07:00
helpers.ts refactor(router): Remove legacy url creation code (#49360) 2023-03-22 16:37:01 +01:00
integration.spec.ts refactor(router): Have router subscribe to transition events to update state (#48427) 2023-08-22 08:04:00 -07:00
page_title_strategy_spec.ts refactor(router): Remove RouterTestingModule in favor of RouterModule.forRoot (#49427) 2023-04-04 15:12:33 -07:00
recognize.spec.ts fix(router): Route matching should only happen once when navigating (#49163) 2023-03-29 14:40:41 -07:00
regression_integration.spec.ts refactor(router): Remove RouterTestingModule in favor of RouterModule.forRoot (#49427) 2023-04-04 15:12:33 -07:00
router.spec.ts refactor(router): Remove RouterTestingModule in favor of RouterModule.forRoot (#49427) 2023-04-04 15:12:33 -07:00
router_link_spec.ts refactor(router): use transform to coerce input values (#50589) 2023-06-06 14:15:50 -07:00
router_preloader.spec.ts fix(router): Ensure Router preloading works with lazy component and static children (#49571) 2023-03-24 10:41:10 -07:00
router_scroller.spec.ts Revert "refactor(router): Remove zone code from router scroller (#49238)" (#49311) 2023-03-03 18:31:04 +00:00
router_state.spec.ts refactor(router): code cleaning (#48259) 2022-12-09 09:59:20 -08:00
shared.spec.ts fix(router): fix error when calling ParamMap.get function (#31599) 2020-06-25 11:57:24 -07:00
standalone.spec.ts refactor(router): Remove RouterTestingModule in favor of RouterModule.forRoot (#49427) 2023-04-04 15:12:33 -07:00
url_serializer.spec.ts revert "fixup! fix(router): fix = not parsed in router segment name" (#47332) 2023-04-11 09:16:31 -07:00
url_tree.spec.ts refactor(router): run spell check on router package (#50445) 2023-05-24 13:56:56 +00:00