Feature Description
RouterTestingHarness exposes the navigateByUrl method, which only accepts a string.
I suggest adding a navigate method, similar to the one exposed by Router. This would allow passing initial configuration such as fragment and query params.
I would be willing to open a pull request to add the feature.
Use Case
The navigate method already offers good ergonomics for handling fragments and query params, but has no equivalent in the testing utils.
In tests, configuring initial fragment or query params requires injecting the router and performing an additional navigation, which is unnecessary boilerplate and differs from how such navigations are handled in source code.
A new method would help avoid boilerplate code and facilitate the creation of a proper initial URL.
Feature Description
RouterTestingHarness exposes the
navigateByUrlmethod, which only accepts a string.I suggest adding a
navigatemethod, similar to the one exposed by Router. This would allow passing initial configuration such as fragment and query params.I would be willing to open a pull request to add the feature.
Use Case
The
navigatemethod already offers good ergonomics for handling fragments and query params, but has no equivalent in the testing utils.In tests, configuring initial fragment or query params requires injecting the router and performing an additional navigation, which is unnecessary boilerplate and differs from how such navigations are handled in source code.
A new method would help avoid boilerplate code and facilitate the creation of a proper initial URL.