angular/packages/router/test
Andrew Scott bcef77d950 fix(router): Fix RouterLink href not updating with queryParamsHandling
There was a bug introduced in #60875. While RouterLink doesn't
necessarily depend on Router state, its link can change when navigations
cause the `ActivatedRoute` paths to change. It is difficult to determine
which segments the link depends on. Luckily, the commit had flawed
logic:

```
!this.queryParamsHandling && !dependsOnRouterState(this.options?.defaultQueryParamsHandling);
```

The subscription gets created whenever `queryParamsHandling` was not
defined, or it was non-default. This is pretty much all scenarios since
nobody is likely to set it explicitly to the default value. In addition,
the `click` handler recomputes the tree because `urlTree` is a getter
that does the computation.

This commit effectively rolls back #60875
2026-01-07 14:08:13 -05:00
..
directives ci: reformat files 2025-12-16 14:44:19 -08:00
integration Revert "refactor(router): Add support for precommitHandler in Navigation integration" 2026-01-07 11:45:58 -05:00
operators test(router): Use autoTick feature in router tests (#62776) 2025-07-24 10:04:05 +00:00
utils refactor: update license text to point to angular.dev (#57901) 2024-09-24 15:33:00 +02:00
apply_redirects.spec.ts feat(router): extend paramters of RedirectFunction to include paramMap and queryParamMap 2026-01-07 12:36:54 -05:00
bootstrap.spec.ts ci: reformat files 2025-12-16 14:44:19 -08:00
BUILD.bazel refactor(router): Intercept navigate events (unless it's a rollback) 2025-11-06 15:00:08 -08:00
computed_state_restoration.spec.ts refactor(router): Build out integration with browser Navigation API (#64905) 2025-11-06 17:42:04 +00:00
config.spec.ts refactor: update license text to point to angular.dev (#57901) 2024-09-24 15:33:00 +02:00
create_router_state.spec.ts refactor(router): Store route injector on ActivatedRoute instance 2025-11-20 17:05:10 -05:00
create_url_tree.spec.ts Revert "fix(router): Ensure createUrlTree does not reuse segments of input" 2026-01-06 16:29:19 -08:00
default_export_component.ts refactor(router): remove standalone true (#58950) 2024-12-05 16:02:37 -08:00
default_export_routes.ts refactor(router): switching to relative imports within the router package (#60557) 2025-04-01 14:54:05 +00:00
helpers.ts refactor(router): Store route injector on ActivatedRoute instance 2025-11-20 17:05:10 -05:00
page_title_strategy_spec.ts ci: reformat files 2025-12-16 14:44:19 -08:00
recognize.spec.ts test(router): Add tests for support of path params before/after a wildcard 2025-12-02 16:46:17 +01:00
regression_integration.spec.ts ci: reformat files 2025-12-16 14:44:19 -08:00
route_injector_cleanup.spec.ts feat(router): add controls for route cleanup 2026-01-05 14:43:56 -05:00
router.spec.ts refactor(router): Store route injector on ActivatedRoute instance 2025-11-20 17:05:10 -05:00
router_devtools.spec.ts feat(devtools): clean up router tree for stable release (#63081) 2025-09-02 20:59:15 -07:00
router_link_active.spec.ts refactor(router): switching to relative imports within the router package (#60557) 2025-04-01 14:54:05 +00:00
router_link_spec.ts fix(router): Fix RouterLink href not updating with queryParamsHandling 2026-01-07 14:08:13 -05:00
router_navigation_extras.spec.ts refactor(router): switching to relative imports within the router package (#60557) 2025-04-01 14:54:05 +00:00
router_preloader.spec.ts test(router): Use autoTick feature in router tests (#62776) 2025-07-24 10:04:05 +00:00
router_scroller.spec.ts refactor(router): simplify imports and improve option access in RouterScroller tests 2025-11-06 09:42:41 -08:00
router_state.spec.ts refactor: update license text to point to angular.dev (#57901) 2024-09-24 15:33:00 +02:00
shared.spec.ts refactor: update license text to point to angular.dev (#57901) 2024-09-24 15:33:00 +02:00
standalone.spec.ts ci: reformat files 2025-12-16 14:44:19 -08:00
tsconfig-test.json refactor(router): Intercept navigate events (unless it's a rollback) 2025-11-06 15:00:08 -08:00
url_serializer.spec.ts refactor: update license text to point to angular.dev (#57901) 2024-09-24 15:33:00 +02:00
url_tree.spec.ts fix(router): handle parenthesized outlets without a name in DefaultUrlSerializer (#64507) 2025-10-23 12:33:57 +02:00
view_transitions.spec.ts ci: reformat files 2025-12-16 14:44:19 -08:00
with_platform_navigation.spec.ts Revert "refactor(router): Add support for precommitHandler in Navigation integration" 2026-01-07 11:45:58 -05:00